You are here

protected function AbstractAtom::_setHubs in Zircon Profile 8

Same name in this branch
  1. 8 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/AbstractAtom.php \Zend\Feed\Writer\Renderer\Feed\AbstractAtom::_setHubs()
  2. 8 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom/AbstractAtom.php \Zend\Feed\Writer\Renderer\Feed\Atom\AbstractAtom::_setHubs()
Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom/AbstractAtom.php \Zend\Feed\Writer\Renderer\Feed\Atom\AbstractAtom::_setHubs()

Set hubs to which this feed pushes

Parameters

DOMDocument $dom:

DOMElement $root:

Return value

void

File

vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom/AbstractAtom.php, line 358

Class

AbstractAtom

Namespace

Zend\Feed\Writer\Renderer\Feed\Atom

Code

protected function _setHubs(DOMDocument $dom, DOMElement $root) {
  $hubs = $this
    ->getDataContainer()
    ->getHubs();
  if (!$hubs) {
    return;
  }
  foreach ($hubs as $hubUrl) {
    $hub = $dom
      ->createElement('link');
    $hub
      ->setAttribute('rel', 'hub');
    $hub
      ->setAttribute('href', $hubUrl);
    $root
      ->appendChild($hub);
  }
}