You are here

protected function Rss::_setDescription in Zircon Profile 8

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

Set feed description

Parameters

DOMDocument $dom:

DOMElement $root:

Return value

void

Throws

Writer\Exception\InvalidArgumentException

1 call to Rss::_setDescription()
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 149

Class

Rss

Namespace

Zend\Feed\Writer\Renderer\Feed

Code

protected function _setDescription(DOMDocument $dom, DOMElement $root) {
  if (!$this
    ->getDataContainer()
    ->getDescription()) {
    $message = 'RSS 2.0 feed elements MUST contain exactly one' . ' description element but one has not been set';
    $exception = new Writer\Exception\InvalidArgumentException($message);
    if (!$this->ignoreExceptions) {
      throw $exception;
    }
    else {
      $this->exceptions[] = $exception;
      return;
    }
  }
  $subtitle = $dom
    ->createElement('description');
  $root
    ->appendChild($subtitle);
  $text = $dom
    ->createTextNode($this
    ->getDataContainer()
    ->getDescription());
  $subtitle
    ->appendChild($text);
}