You are here

public function Source::render in Zircon Profile 8.0

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

Render Atom Feed Metadata (Source element)

Return value

Writer\Renderer\Feed\Atom

File

vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom/Source.php, line 34

Class

Source

Namespace

Zend\Feed\Writer\Renderer\Feed\Atom

Code

public function render() {
  if (!$this->container
    ->getEncoding()) {
    $this->container
      ->setEncoding('UTF-8');
  }
  $this->dom = new DOMDocument('1.0', $this->container
    ->getEncoding());
  $this->dom->formatOutput = true;
  $root = $this->dom
    ->createElement('source');
  $this
    ->setRootElement($root);
  $this->dom
    ->appendChild($root);
  $this
    ->_setLanguage($this->dom, $root);
  $this
    ->_setBaseUrl($this->dom, $root);
  $this
    ->_setTitle($this->dom, $root);
  $this
    ->_setDescription($this->dom, $root);
  $this
    ->_setDateCreated($this->dom, $root);
  $this
    ->_setDateModified($this->dom, $root);
  $this
    ->_setGenerator($this->dom, $root);
  $this
    ->_setLink($this->dom, $root);
  $this
    ->_setFeedLinks($this->dom, $root);
  $this
    ->_setId($this->dom, $root);
  $this
    ->_setAuthors($this->dom, $root);
  $this
    ->_setCopyright($this->dom, $root);
  $this
    ->_setCategories($this->dom, $root);
  foreach ($this->extensions as $ext) {
    $ext
      ->setType($this
      ->getType());
    $ext
      ->setRootElement($this
      ->getRootElement());
    $ext
      ->setDomDocument($this
      ->getDomDocument(), $root);
    $ext
      ->render();
  }
  return $this;
}