public function Feed::getDateCreated in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Feed.php \Zend\Feed\Reader\Extension\Atom\Feed::getDateCreated()
Get the feed creation date
Return value
DateTime|null
File
- vendor/
zendframework/ zend-feed/ src/ Reader/ Extension/ Atom/ Feed.php, line 108
Class
Namespace
Zend\Feed\Reader\Extension\AtomCode
public function getDateCreated() {
if (array_key_exists('datecreated', $this->data)) {
return $this->data['datecreated'];
}
$date = null;
if ($this
->getType() === Reader\Reader::TYPE_ATOM_03) {
$dateCreated = $this->xpath
->evaluate('string(' . $this
->getXpathPrefix() . '/atom:created)');
}
else {
$dateCreated = $this->xpath
->evaluate('string(' . $this
->getXpathPrefix() . '/atom:published)');
}
if ($dateCreated) {
$date = new DateTime($dateCreated);
}
$this->data['datecreated'] = $date;
return $this->data['datecreated'];
}