You are here

protected function Atom::_setSource in Zircon Profile 8.0

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

Append Source element (Atom 1.0 Feed Metadata)

Parameters

DOMDocument $dom:

DOMElement $root:

Return value

void

1 call to Atom::_setSource()
Atom::render in vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Atom.php
Render atom entry

File

vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Atom.php, line 422

Class

Atom

Namespace

Zend\Feed\Writer\Renderer\Entry

Code

protected function _setSource(DOMDocument $dom, DOMElement $root) {
  $source = $this
    ->getDataContainer()
    ->getSource();
  if (!$source) {
    return;
  }
  $renderer = new Renderer\Feed\AtomSource($source);
  $renderer
    ->setType($this
    ->getType());
  $element = $renderer
    ->render()
    ->getElement();
  $imported = $dom
    ->importNode($element, true);
  $root
    ->appendChild($imported);
}