public function Entry::getDate in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/zendframework/zend-feed/src/Reader/Extension/DublinCore/Entry.php \Zend\Feed\Reader\Extension\DublinCore\Entry::getDate()
Return value
DateTime|null
File
- vendor/
zendframework/ zend-feed/ src/ Reader/ Extension/ DublinCore/ Entry.php, line 202
Class
Namespace
Zend\Feed\Reader\Extension\DublinCoreCode
public function getDate() {
if (array_key_exists('date', $this->data)) {
return $this->data['date'];
}
$d = null;
$date = $this
->getXpath()
->evaluate('string(' . $this
->getXpathPrefix() . '/dc11:date)');
if (!$date) {
$date = $this
->getXpath()
->evaluate('string(' . $this
->getXpathPrefix() . '/dc10:date)');
}
if ($date) {
$d = new DateTime($date);
}
$this->data['date'] = $d;
return $this->data['date'];
}