You are here

public function Entry::getLinks in Zircon Profile 8

Same name in this branch
  1. 8 vendor/zendframework/zend-feed/src/Writer/Entry.php \Zend\Feed\Writer\Entry::getLinks()
  2. 8 vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Entry.php \Zend\Feed\Reader\Extension\Atom\Entry::getLinks()
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::getLinks()

Get all links

Return value

array

1 call to Entry::getLinks()
Entry::getLink in vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Entry.php
Get a specific link

File

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

Class

Entry

Namespace

Zend\Feed\Reader\Extension\Atom

Code

public function getLinks() {
  if (array_key_exists('links', $this->data)) {
    return $this->data['links'];
  }
  $links = [];
  $list = $this
    ->getXpath()
    ->query($this
    ->getXpathPrefix() . '//atom:link[@rel="alternate"]/@href' . '|' . $this
    ->getXpathPrefix() . '//atom:link[not(@rel)]/@href');
  if ($list->length) {
    foreach ($list as $link) {
      $links[] = $this
        ->absolutiseUri($link->value);
    }
  }
  $this->data['links'] = $links;
  return $this->data['links'];
}