You are here

public function Feed::getHubs in Zircon Profile 8.0

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

Get an array of any supported Pusubhubbub endpoints

Return value

array|null

File

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

Class

Feed

Namespace

Zend\Feed\Reader\Extension\Atom

Code

public function getHubs() {
  if (array_key_exists('hubs', $this->data)) {
    return $this->data['hubs'];
  }
  $hubs = [];
  $list = $this->xpath
    ->query($this
    ->getXpathPrefix() . '//atom:link[@rel="hub"]/@href');
  if ($list->length) {
    foreach ($list as $uri) {
      $hubs[] = $this
        ->absolutiseUri($uri->nodeValue);
    }
  }
  else {
    $hubs = null;
  }
  $this->data['hubs'] = $hubs;
  return $this->data['hubs'];
}