You are here

public function Rss::getTitle in Zircon Profile 8

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

Get the entry title

Return value

string

Overrides EntryInterface::getTitle

1 call to Rss::getTitle()
Rss::getId in vendor/zendframework/zend-feed/src/Reader/Entry/Rss.php
Get the entry ID

File

vendor/zendframework/zend-feed/src/Reader/Entry/Rss.php, line 457

Class

Rss

Namespace

Zend\Feed\Reader\Entry

Code

public function getTitle() {
  if (array_key_exists('title', $this->data)) {
    return $this->data['title'];
  }
  $title = null;
  if ($this
    ->getType() !== Reader\Reader::TYPE_RSS_10 && $this
    ->getType() !== Reader\Reader::TYPE_RSS_090) {
    $title = $this->xpath
      ->evaluate('string(' . $this->xpathQueryRss . '/title)');
  }
  else {
    $title = $this->xpath
      ->evaluate('string(' . $this->xpathQueryRdf . '/rss:title)');
  }
  if (!$title) {
    $title = $this
      ->getExtension('DublinCore')
      ->getTitle();
  }
  if (!$title) {
    $title = $this
      ->getExtension('Atom')
      ->getTitle();
  }
  if (!$title) {
    $title = null;
  }
  $this->data['title'] = $title;
  return $this->data['title'];
}