protected function AbstractAtom::_setDateModified in Zircon Profile 8
Same name in this branch
- 8 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/AbstractAtom.php \Zend\Feed\Writer\Renderer\Feed\AbstractAtom::_setDateModified()
- 8 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom/AbstractAtom.php \Zend\Feed\Writer\Renderer\Feed\Atom\AbstractAtom::_setDateModified()
Same name and namespace in other branches
- 8.0 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom/AbstractAtom.php \Zend\Feed\Writer\Renderer\Feed\Atom\AbstractAtom::_setDateModified()
Set date feed was last modified
Parameters
DOMDocument $dom:
DOMElement $root:
Return value
void
Throws
Feed\Exception\InvalidArgumentException
1 call to AbstractAtom::_setDateModified()
- Source::render in vendor/
zendframework/ zend-feed/ src/ Writer/ Renderer/ Feed/ Atom/ Source.php - Render Atom Feed Metadata (Source element)
File
- vendor/
zendframework/ zend-feed/ src/ Writer/ Renderer/ Feed/ Atom/ AbstractAtom.php, line 101
Class
Namespace
Zend\Feed\Writer\Renderer\Feed\AtomCode
protected function _setDateModified(DOMDocument $dom, DOMElement $root) {
if (!$this
->getDataContainer()
->getDateModified()) {
$message = 'Atom 1.0 feed elements MUST contain exactly one' . ' atom:updated element but a modification date has not been set';
$exception = new Feed\Exception\InvalidArgumentException($message);
if (!$this->ignoreExceptions) {
throw $exception;
}
else {
$this->exceptions[] = $exception;
return;
}
}
$updated = $dom
->createElement('updated');
$root
->appendChild($updated);
$text = $dom
->createTextNode($this
->getDataContainer()
->getDateModified()
->format(DateTime::ATOM));
$updated
->appendChild($text);
}