You are here

public function Feed::getTitle in Zircon Profile 8

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

Get the feed title

Return value

string|null

File

vendor/zendframework/zend-feed/src/Reader/Extension/DublinCore/Feed.php, line 184

Class

Feed

Namespace

Zend\Feed\Reader\Extension\DublinCore

Code

public function getTitle() {
  if (array_key_exists('title', $this->data)) {
    return $this->data['title'];
  }
  $title = $this
    ->getXpath()
    ->evaluate('string(' . $this
    ->getXpathPrefix() . '/dc11:title)');
  if (!$title) {
    $title = $this
      ->getXpath()
      ->evaluate('string(' . $this
      ->getXpathPrefix() . '/dc10:title)');
  }
  if (!$title) {
    $title = null;
  }
  $this->data['title'] = $title;
  return $this->data['title'];
}