3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Feed\Reader\Feed\Atom;
15 use Zend\Feed\Reader\Feed;
19 class Source extends Feed\Atom
22 * Constructor: Create a Source object which is largely just a normal
23 * Zend\Feed\Reader\AbstractFeed object only designed to retrieve feed level
24 * metadata from an Atom entry's source element.
26 * @param DOMElement $source
27 * @param string $xpathPrefix Passed from parent Entry object
28 * @param string $type Nearly always Atom 1.0
30 public function __construct(DOMElement $source, $xpathPrefix, $type = Reader\Reader::TYPE_ATOM_10)
32 $this->domDocument = $source->ownerDocument;
33 $this->xpath = new DOMXPath($this->domDocument);
34 $this->data['type'] = $type;
35 $this->registerNamespaces();
36 $this->loadExtensions();
38 $manager = Reader\Reader::getExtensionManager();
39 $extensions = ['Atom\Feed', 'DublinCore\Feed'];
41 foreach ($extensions as $name) {
42 $extension = $manager->get($name);
43 $extension->setDomDocument($this->domDocument);
44 $extension->setType($this->data['type']);
45 $extension->setXpath($this->xpath);
46 $this->extensions[$name] = $extension;
49 foreach ($this->extensions as $extension) {
50 $extension->setXpathPrefix(rtrim($xpathPrefix, '/') . '/atom:source');
55 * Since this is not an Entry carrier but a vehicle for Feed metadata, any
56 * applicable Entry methods are stubbed out and do nothing.
62 public function count()
69 public function current()
83 public function next()
90 public function rewind()
97 public function valid()
104 protected function indexEntries()