public function Feed::getDate in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/zendframework/zend-feed/src/Reader/Extension/DublinCore/Feed.php \Zend\Feed\Reader\Extension\DublinCore\Feed::getDate()
Return value
DateTime|null
File
- vendor/
zendframework/ zend-feed/ src/ Reader/ Extension/ DublinCore/ Feed.php, line 210
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'];
}