You are here

protected function Source::_setGenerator in Zircon Profile 8

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

Set feed generator string

Parameters

DOMDocument $dom:

DOMElement $root:

Return value

void

Overrides AbstractAtom::_setGenerator

1 call to Source::_setGenerator()
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/Source.php, line 74

Class

Source

Namespace

Zend\Feed\Writer\Renderer\Feed\Atom

Code

protected function _setGenerator(DOMDocument $dom, DOMElement $root) {
  if (!$this
    ->getDataContainer()
    ->getGenerator()) {
    return;
  }
  $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']);
  }
}