You are here

protected function AbstractAtom::_setGenerator in Zircon Profile 8.0

Same name in this branch
  1. 8.0 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/AbstractAtom.php \Zend\Feed\Writer\Renderer\Feed\AbstractAtom::_setGenerator()
  2. 8.0 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom/AbstractAtom.php \Zend\Feed\Writer\Renderer\Feed\Atom\AbstractAtom::_setGenerator()
Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom/AbstractAtom.php \Zend\Feed\Writer\Renderer\Feed\Atom\AbstractAtom::_setGenerator()

Set feed generator string

Parameters

DOMDocument $dom:

DOMElement $root:

Return value

void

1 method overrides AbstractAtom::_setGenerator()
Source::_setGenerator in vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom/Source.php
Set feed generator string

File

vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom/AbstractAtom.php, line 130

Class

AbstractAtom

Namespace

Zend\Feed\Writer\Renderer\Feed\Atom

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);
  $text = $dom
    ->createTextNode($gdata['name']);
  $generator
    ->appendChild($text);
  if (array_key_exists('uri', $gdata)) {
    $generator
      ->setAttribute('uri', $gdata['uri']);
  }
  if (array_key_exists('version', $gdata)) {
    $generator
      ->setAttribute('version', $gdata['version']);
  }
}