You are here

public function Feed::getUpdatePeriod in Zircon Profile 8

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

Get update period

Return value

string

Throws

Reader\Exception\InvalidArgumentException

1 call to Feed::getUpdatePeriod()
Feed::getUpdateFrequencyAsTicks in vendor/zendframework/zend-feed/src/Reader/Extension/Syndication/Feed.php
Get update frequency as ticks

File

vendor/zendframework/zend-feed/src/Reader/Extension/Syndication/Feed.php, line 24

Class

Feed

Namespace

Zend\Feed\Reader\Extension\Syndication

Code

public function getUpdatePeriod() {
  $name = 'updatePeriod';
  $period = $this
    ->getData($name);
  if ($period === null) {
    $this->data[$name] = 'daily';
    return 'daily';

    //Default specified by spec
  }
  switch ($period) {
    case 'hourly':
    case 'daily':
    case 'weekly':
    case 'yearly':
      return $period;
    default:
      throw new Reader\Exception\InvalidArgumentException("Feed specified invalid update period: '{$period}'." . " Must be one of hourly, daily, weekly or yearly");
  }
}