You are here

public function Entry::getId in Zircon Profile 8

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

Get the entry ID

Return value

string

File

vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Entry.php, line 266

Class

Entry

Namespace

Zend\Feed\Reader\Extension\Atom

Code

public function getId() {
  if (array_key_exists('id', $this->data)) {
    return $this->data['id'];
  }
  $id = $this
    ->getXpath()
    ->evaluate('string(' . $this
    ->getXpathPrefix() . '/atom:id)');
  if (!$id) {
    if ($this
      ->getPermalink()) {
      $id = $this
        ->getPermalink();
    }
    elseif ($this
      ->getTitle()) {
      $id = $this
        ->getTitle();
    }
    else {
      $id = null;
    }
  }
  $this->data['id'] = $id;
  return $this->data['id'];
}