You are here

public function Rss::__construct in Zircon Profile 8

Same name in this branch
  1. 8 vendor/zendframework/zend-feed/src/Reader/Entry/Rss.php \Zend\Feed\Reader\Entry\Rss::__construct()
  2. 8 vendor/zendframework/zend-feed/src/Reader/Feed/Rss.php \Zend\Feed\Reader\Feed\Rss::__construct()
  3. 8 vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Rss.php \Zend\Feed\Writer\Renderer\Entry\Rss::__construct()
  4. 8 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Rss.php \Zend\Feed\Writer\Renderer\Feed\Rss::__construct()
  5. 8 core/modules/node/src/Plugin/views/row/Rss.php \Drupal\node\Plugin\views\row\Rss::__construct()
Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-feed/src/Reader/Feed/Rss.php \Zend\Feed\Reader\Feed\Rss::__construct()

Constructor

Parameters

DOMDocument $dom:

string $type:

Overrides AbstractFeed::__construct

File

vendor/zendframework/zend-feed/src/Reader/Feed/Rss.php, line 28

Class

Rss

Namespace

Zend\Feed\Reader\Feed

Code

public function __construct(DOMDocument $dom, $type = null) {
  parent::__construct($dom, $type);
  $manager = Reader\Reader::getExtensionManager();
  $feed = $manager
    ->get('DublinCore\\Feed');
  $feed
    ->setDomDocument($dom);
  $feed
    ->setType($this->data['type']);
  $feed
    ->setXpath($this->xpath);
  $this->extensions['DublinCore\\Feed'] = $feed;
  $feed = $manager
    ->get('Atom\\Feed');
  $feed
    ->setDomDocument($dom);
  $feed
    ->setType($this->data['type']);
  $feed
    ->setXpath($this->xpath);
  $this->extensions['Atom\\Feed'] = $feed;
  if ($this
    ->getType() !== Reader\Reader::TYPE_RSS_10 && $this
    ->getType() !== Reader\Reader::TYPE_RSS_090) {
    $xpathPrefix = '/rss/channel';
  }
  else {
    $xpathPrefix = '/rdf:RDF/rss:channel';
  }
  foreach ($this->extensions as $extension) {
    $extension
      ->setXpathPrefix($xpathPrefix);
  }
}