public function Entry::getDateCreated in Zircon Profile 8.0
Same name in this branch
- 8.0 vendor/zendframework/zend-feed/src/Writer/Entry.php \Zend\Feed\Writer\Entry::getDateCreated()
- 8.0 vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Entry.php \Zend\Feed\Reader\Extension\Atom\Entry::getDateCreated()
Same name and namespace in other branches
- 8 vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Entry.php \Zend\Feed\Reader\Extension\Atom\Entry::getDateCreated()
Get the entry creation date
Return value
string
File
- vendor/
zendframework/ zend-feed/ src/ Reader/ Extension/ Atom/ Entry.php, line 161
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
->getAtomType() === Reader\Reader::TYPE_ATOM_03) {
$dateCreated = $this
->getXpath()
->evaluate('string(' . $this
->getXpathPrefix() . '/atom:created)');
}
else {
$dateCreated = $this
->getXpath()
->evaluate('string(' . $this
->getXpathPrefix() . '/atom:published)');
}
if ($dateCreated) {
$date = new DateTime($dateCreated);
}
$this->data['datecreated'] = $date;
return $this->data['datecreated'];
}