You are here

public function Feed::getDateModified in Zircon Profile 8.0

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

Get the feed modification date

Return value

DateTime|null

File

vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Feed.php, line 136

Class

Feed

Namespace

Zend\Feed\Reader\Extension\Atom

Code

public function getDateModified() {
  if (array_key_exists('datemodified', $this->data)) {
    return $this->data['datemodified'];
  }
  $date = null;
  if ($this
    ->getType() === Reader\Reader::TYPE_ATOM_03) {
    $dateModified = $this->xpath
      ->evaluate('string(' . $this
      ->getXpathPrefix() . '/atom:modified)');
  }
  else {
    $dateModified = $this->xpath
      ->evaluate('string(' . $this
      ->getXpathPrefix() . '/atom:updated)');
  }
  if ($dateModified) {
    $date = new DateTime($dateModified);
  }
  $this->data['datemodified'] = $date;
  return $this->data['datemodified'];
}