You are here

public function Feed::getDescription in Zircon Profile 8.0

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

Get the feed description

Return value

string|null

File

vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Feed.php, line 164

Class

Feed

Namespace

Zend\Feed\Reader\Extension\Atom

Code

public function getDescription() {
  if (array_key_exists('description', $this->data)) {
    return $this->data['description'];
  }
  $description = null;
  if ($this
    ->getType() === Reader\Reader::TYPE_ATOM_03) {
    $description = $this->xpath
      ->evaluate('string(' . $this
      ->getXpathPrefix() . '/atom:tagline)');
  }
  else {
    $description = $this->xpath
      ->evaluate('string(' . $this
      ->getXpathPrefix() . '/atom:subtitle)');
  }
  if (!$description) {
    $description = null;
  }
  $this->data['description'] = $description;
  return $this->data['description'];
}