You are here

public function Feed::getLink in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Feed.php \Zend\Feed\Reader\Extension\Atom\Feed::getLink()

Get a link to the source website

Return value

string|null

1 call to Feed::getLink()
Feed::getId in vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Feed.php
Get the feed ID

File

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

Class

Feed

Namespace

Zend\Feed\Reader\Extension\Atom

Code

public function getLink() {
  if (array_key_exists('link', $this->data)) {
    return $this->data['link'];
  }
  $link = null;
  $list = $this->xpath
    ->query($this
    ->getXpathPrefix() . '/atom:link[@rel="alternate"]/@href' . '|' . $this
    ->getXpathPrefix() . '/atom:link[not(@rel)]/@href');
  if ($list->length) {
    $link = $list
      ->item(0)->nodeValue;
    $link = $this
      ->absolutiseUri($link);
  }
  $this->data['link'] = $link;
  return $this->data['link'];
}