You are here

public function Entry::setItunesKeywords in Zircon Profile 8

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

Set keywords

Parameters

array $value:

Return value

Entry

Throws

Writer\Exception\InvalidArgumentException

File

vendor/zendframework/zend-feed/src/Writer/Extension/ITunes/Entry.php, line 170

Class

Entry

Namespace

Zend\Feed\Writer\Extension\ITunes

Code

public function setItunesKeywords(array $value) {
  if (count($value) > 12) {
    throw new Writer\Exception\InvalidArgumentException('invalid parameter: "keywords" may only' . ' contain a maximum of 12 terms');
  }
  $concat = implode(',', $value);
  if ($this->stringWrapper
    ->strlen($concat) > 255) {
    throw new Writer\Exception\InvalidArgumentException('invalid parameter: "keywords" may only' . ' have a concatenated length of 255 chars where terms are delimited' . ' by a comma');
  }
  $this->data['keywords'] = $value;
  return $this;
}