You are here

public function Feed::setItunesImage in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Feed.php \Zend\Feed\Writer\Extension\ITunes\Feed::setItunesImage()

Set feed image (icon)

Parameters

string $value:

Return value

Feed

Throws

Writer\Exception\InvalidArgumentException

File

vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Feed.php, line 172

Class

Feed

Namespace

Zend\Feed\Writer\Extension\ITunes

Code

public function setItunesImage($value) {
  if (!Uri::factory($value)
    ->isValid()) {
    throw new Writer\Exception\InvalidArgumentException('invalid parameter: "image" may only' . ' be a valid URI/IRI');
  }
  if (!in_array(substr($value, -3), [
    'jpg',
    'png',
  ])) {
    throw new Writer\Exception\InvalidArgumentException('invalid parameter: "image" may only' . ' use file extension "jpg" or "png" which must be the last three' . ' characters of the URI (i.e. no query string or fragment)');
  }
  $this->data['image'] = $value;
  return $this;
}