You are here

protected function Rss::_setTitle 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::_setTitle()
  2. 8 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Rss.php \Zend\Feed\Writer\Renderer\Feed\Rss::_setTitle()
Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Rss.php \Zend\Feed\Writer\Renderer\Entry\Rss::_setTitle()

Set entry title

Parameters

DOMDocument $dom:

DOMElement $root:

Return value

void

Throws

Writer\Exception\InvalidArgumentException

1 call to Rss::_setTitle()
Rss::render in vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Rss.php
Render RSS entry

File

vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Rss.php, line 74

Class

Rss

Namespace

Zend\Feed\Writer\Renderer\Entry

Code

protected function _setTitle(DOMDocument $dom, DOMElement $root) {
  if (!$this
    ->getDataContainer()
    ->getDescription() && !$this
    ->getDataContainer()
    ->getTitle()) {
    $message = 'RSS 2.0 entry elements SHOULD contain exactly one' . ' title element but a title has not been set. In addition, there' . ' is no description as required in the absence of a title.';
    $exception = new Writer\Exception\InvalidArgumentException($message);
    if (!$this->ignoreExceptions) {
      throw $exception;
    }
    else {
      $this->exceptions[] = $exception;
      return;
    }
  }
  $title = $dom
    ->createElement('title');
  $root
    ->appendChild($title);
  $text = $dom
    ->createTextNode($this
    ->getDataContainer()
    ->getTitle());
  $title
    ->appendChild($text);
}