You are here

public function Rss::getLinks in Zircon Profile 8

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

Get all links

Return value

array

Overrides EntryInterface::getLinks

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

File

vendor/zendframework/zend-feed/src/Reader/Entry/Rss.php, line 374

Class

Rss

Namespace

Zend\Feed\Reader\Entry

Code

public function getLinks() {
  if (array_key_exists('links', $this->data)) {
    return $this->data['links'];
  }
  $links = [];
  if ($this
    ->getType() !== Reader\Reader::TYPE_RSS_10 && $this
    ->getType() !== Reader\Reader::TYPE_RSS_090) {
    $list = $this->xpath
      ->query($this->xpathQueryRss . '//link');
  }
  else {
    $list = $this->xpath
      ->query($this->xpathQueryRdf . '//rss:link');
  }
  if (!$list->length) {
    $links = $this
      ->getExtension('Atom')
      ->getLinks();
  }
  else {
    foreach ($list as $link) {
      $links[] = $link->nodeValue;
    }
  }
  $this->data['links'] = $links;
  return $this->data['links'];
}