You are here

public function Feed::getId 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::getId()
  2. 8 vendor/zendframework/zend-feed/src/Reader/Extension/DublinCore/Feed.php \Zend\Feed\Reader\Extension\DublinCore\Feed::getId()
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::getId()

Get the feed ID

Return value

string|null

File

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

Class

Feed

Namespace

Zend\Feed\Reader\Extension\DublinCore

Code

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