You are here

public function Entry::setItunesDuration 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::setItunesDuration()

Set duration

Parameters

int $value:

Return value

Entry

Throws

Writer\Exception\InvalidArgumentException

File

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

Class

Entry

Namespace

Zend\Feed\Writer\Extension\ITunes

Code

public function setItunesDuration($value) {
  $value = (string) $value;
  if (!ctype_digit($value) && !preg_match("/^\\d+:[0-5]{1}[0-9]{1}\$/", $value) && !preg_match("/^\\d+:[0-5]{1}[0-9]{1}:[0-5]{1}[0-9]{1}\$/", $value)) {
    throw new Writer\Exception\InvalidArgumentException('invalid parameter: "duration" may only' . ' be of a specified [[HH:]MM:]SS format');
  }
  $this->data['duration'] = $value;
  return $this;
}