You are here

protected function Rss::_setGenerator in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Rss.php \Zend\Feed\Writer\Renderer\Feed\Rss::_setGenerator()

Set feed generator string

Parameters

DOMDocument $dom:

DOMElement $root:

Return value

void

1 call to Rss::_setGenerator()
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 196

Class

Rss

Namespace

Zend\Feed\Writer\Renderer\Feed

Code

protected function _setGenerator(DOMDocument $dom, DOMElement $root) {
  if (!$this
    ->getDataContainer()
    ->getGenerator()) {
    $this
      ->getDataContainer()
      ->setGenerator('Zend_Feed_Writer', Version::VERSION, 'http://framework.zend.com');
  }
  $gdata = $this
    ->getDataContainer()
    ->getGenerator();
  $generator = $dom
    ->createElement('generator');
  $root
    ->appendChild($generator);
  $name = $gdata['name'];
  if (array_key_exists('version', $gdata)) {
    $name .= ' ' . $gdata['version'];
  }
  if (array_key_exists('uri', $gdata)) {
    $name .= ' (' . $gdata['uri'] . ')';
  }
  $text = $dom
    ->createTextNode($name);
  $generator
    ->appendChild($text);
}