You are here

public function Entry::getDateModified in Zircon Profile 8.0

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

Get the entry modification date

Return value

string

File

vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Entry.php, line 189

Class

Entry

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
    ->getAtomType() === Reader\Reader::TYPE_ATOM_03) {
    $dateModified = $this
      ->getXpath()
      ->evaluate('string(' . $this
      ->getXpathPrefix() . '/atom:modified)');
  }
  else {
    $dateModified = $this
      ->getXpath()
      ->evaluate('string(' . $this
      ->getXpathPrefix() . '/atom:updated)');
  }
  if ($dateModified) {
    $date = new DateTime($dateModified);
  }
  $this->data['datemodified'] = $date;
  return $this->data['datemodified'];
}