comparison vendor/zendframework/zend-feed/src/Reader/Feed/Atom/Source.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
4 *
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
8 */
9
10 namespace Zend\Feed\Reader\Feed\Atom;
11
12 use DOMElement;
13 use DOMXPath;
14 use Zend\Feed\Reader;
15 use Zend\Feed\Reader\Feed;
16
17 /**
18 */
19 class Source extends Feed\Atom
20 {
21 /**
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.
25 *
26 * @param DOMElement $source
27 * @param string $xpathPrefix Passed from parent Entry object
28 * @param string $type Nearly always Atom 1.0
29 */
30 public function __construct(DOMElement $source, $xpathPrefix, $type = Reader\Reader::TYPE_ATOM_10)
31 {
32 $this->domDocument = $source->ownerDocument;
33 $this->xpath = new DOMXPath($this->domDocument);
34 $this->data['type'] = $type;
35 $this->registerNamespaces();
36 $this->loadExtensions();
37
38 $manager = Reader\Reader::getExtensionManager();
39 $extensions = ['Atom\Feed', 'DublinCore\Feed'];
40
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;
47 }
48
49 foreach ($this->extensions as $extension) {
50 $extension->setXpathPrefix(rtrim($xpathPrefix, '/') . '/atom:source');
51 }
52 }
53
54 /**
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.
57 */
58
59 /**
60 * @return void
61 */
62 public function count()
63 {
64 }
65
66 /**
67 * @return void
68 */
69 public function current()
70 {
71 }
72
73 /**
74 * @return void
75 */
76 public function key()
77 {
78 }
79
80 /**
81 * @return void
82 */
83 public function next()
84 {
85 }
86
87 /**
88 * @return void
89 */
90 public function rewind()
91 {
92 }
93
94 /**
95 * @return void
96 */
97 public function valid()
98 {
99 }
100
101 /**
102 * @return void
103 */
104 protected function indexEntries()
105 {
106 }
107 }