3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 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
23 * Constructor: Create a Source object which is largely just a normal
24 * Zend\Feed\Reader\AbstractFeed object only designed to retrieve feed level
25 * metadata from an Atom entry's source element.
27 * @param DOMElement $source
28 * @param string $xpathPrefix Passed from parent Entry object
29 * @param string $type Nearly always Atom 1.0
31 public function __construct(DOMElement
$source, $xpathPrefix, $type = Reader\Reader
::TYPE_ATOM_10
)
33 $this->domDocument
= $source->ownerDocument
;
34 $this->xpath
= new DOMXPath($this->domDocument
);
35 $this->data
['type'] = $type;
36 $this->registerNamespaces();
37 $this->loadExtensions();
39 $manager = Reader\Reader
::getExtensionManager();
40 $extensions = array('Atom\Feed', 'DublinCore\Feed');
42 foreach ($extensions as $name) {
43 $extension = $manager->get($name);
44 $extension->setDomDocument($this->domDocument
);
45 $extension->setType($this->data
['type']);
46 $extension->setXpath($this->xpath
);
47 $this->extensions
[$name] = $extension;
50 foreach ($this->extensions
as $extension) {
51 $extension->setXpathPrefix(rtrim($xpathPrefix, '/') . '/atom:source');
56 * Since this is not an Entry carrier but a vehicle for Feed metadata, any
57 * applicable Entry methods are stubbed out and do nothing.
63 public function count() {}
68 public function current() {}
73 public function key() {}
78 public function next() {}
83 public function rewind() {}
88 public function valid() {}
93 protected function indexEntries() {}