protected function Rss::_setCategories in Zircon Profile 8
Same name in this branch
- 8 vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Rss.php \Zend\Feed\Writer\Renderer\Entry\Rss::_setCategories()
- 8 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Rss.php \Zend\Feed\Writer\Renderer\Feed\Rss::_setCategories()
Same name and namespace in other branches
- 8.0 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Rss.php \Zend\Feed\Writer\Renderer\Feed\Rss::_setCategories()
Set feed categories
Parameters
DOMDocument $dom:
DOMElement $root:
Return value
void
1 call to Rss::_setCategories()
- Rss::render in vendor/
zendframework/ zend-feed/ src/ Writer/ Renderer/ Feed/ Rss.php - Render RSS feed
File
- vendor/
zendframework/ zend-feed/ src/ Writer/ Renderer/ Feed/ Rss.php, line 472
Class
Namespace
Zend\Feed\Writer\Renderer\FeedCode
protected function _setCategories(DOMDocument $dom, DOMElement $root) {
$categories = $this
->getDataContainer()
->getCategories();
if (!$categories) {
return;
}
foreach ($categories as $cat) {
$category = $dom
->createElement('category');
if (isset($cat['scheme'])) {
$category
->setAttribute('domain', $cat['scheme']);
}
$text = $dom
->createTextNode($cat['term']);
$category
->appendChild($text);
$root
->appendChild($category);
}
}