protected function AbstractAtom::_setFeedLinks 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::_setFeedLinks()
- 8 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom/AbstractAtom.php \Zend\Feed\Writer\Renderer\Feed\Atom\AbstractAtom::_setFeedLinks()
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::_setFeedLinks()
Set feed links
Parameters
DOMDocument $dom:
DOMElement $root:
Return value
void
Throws
Feed\Exception\InvalidArgumentException
1 call to AbstractAtom::_setFeedLinks()
- 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 177
Class
Namespace
Zend\Feed\Writer\Renderer\Feed\AtomCode
protected function _setFeedLinks(DOMDocument $dom, DOMElement $root) {
$flinks = $this
->getDataContainer()
->getFeedLinks();
if (!$flinks || !array_key_exists('atom', $flinks)) {
$message = 'Atom 1.0 feed elements SHOULD contain one atom:link ' . 'element with a rel attribute value of "self". This is the ' . 'preferred URI for retrieving Atom Feed Documents representing ' . 'this Atom feed but a feed link has not been set';
$exception = new Feed\Exception\InvalidArgumentException($message);
if (!$this->ignoreExceptions) {
throw $exception;
}
else {
$this->exceptions[] = $exception;
return;
}
}
foreach ($flinks as $type => $href) {
$mime = 'application/' . strtolower($type) . '+xml';
$flink = $dom
->createElement('link');
$root
->appendChild($flink);
$flink
->setAttribute('rel', 'self');
$flink
->setAttribute('type', $mime);
$flink
->setAttribute('href', $href);
}
}