protected function AbstractAtom::_setTitle in Zircon Profile 8.0
Same name in this branch
- 8.0 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/AbstractAtom.php \Zend\Feed\Writer\Renderer\Feed\AbstractAtom::_setTitle()
- 8.0 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom/AbstractAtom.php \Zend\Feed\Writer\Renderer\Feed\Atom\AbstractAtom::_setTitle()
Same name and namespace in other branches
- 8 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom/AbstractAtom.php \Zend\Feed\Writer\Renderer\Feed\Atom\AbstractAtom::_setTitle()
Set feed title
Parameters
DOMDocument $dom:
DOMElement $root:
Return value
void
Throws
Feed\Exception\InvalidArgumentException
1 call to AbstractAtom::_setTitle()
- 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 53
Class
Namespace
Zend\Feed\Writer\Renderer\Feed\AtomCode
protected function _setTitle(DOMDocument $dom, DOMElement $root) {
if (!$this
->getDataContainer()
->getTitle()) {
$message = 'Atom 1.0 feed elements MUST contain exactly one' . ' atom:title element but a title has not been set';
$exception = new Feed\Exception\InvalidArgumentException($message);
if (!$this->ignoreExceptions) {
throw $exception;
}
else {
$this->exceptions[] = $exception;
return;
}
}
$title = $dom
->createElement('title');
$root
->appendChild($title);
$title
->setAttribute('type', 'text');
$text = $dom
->createTextNode($this
->getDataContainer()
->getTitle());
$title
->appendChild($text);
}