1 | <?php |
||
20 | class Node implements NodeInterface |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * @var \ArrayIterator |
||
25 | */ |
||
26 | protected $elements; |
||
27 | |||
28 | /** |
||
29 | * @var \ArrayIterator |
||
30 | */ |
||
31 | protected $categories; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $title; |
||
37 | |||
38 | /** |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $publicId; |
||
42 | |||
43 | /** |
||
44 | * @var string |
||
45 | */ |
||
46 | protected $description; |
||
47 | |||
48 | /** |
||
49 | * @var \DateTime |
||
50 | */ |
||
51 | protected $lastModified; |
||
52 | |||
53 | /** |
||
54 | * @var string |
||
55 | */ |
||
56 | protected $link; |
||
57 | |||
58 | public function __construct() |
||
63 | |||
64 | /** |
||
65 | * @param string $name element name |
||
66 | * @param string $value element value |
||
67 | * @return $this |
||
68 | */ |
||
69 | public function set($name, $value) |
||
80 | |||
81 | /** |
||
82 | * returns node's categories |
||
83 | * |
||
84 | * @return \ArrayIterator |
||
85 | */ |
||
86 | public function getCategories() |
||
90 | |||
91 | /** |
||
92 | * @return \Generator |
||
93 | */ |
||
94 | public function getCategoriesGenerator() |
||
100 | |||
101 | /** |
||
102 | * adds a category to the node |
||
103 | * |
||
104 | * @param \FeedIo\Feed\Node\CategoryInterface $category |
||
105 | * @return $this |
||
106 | */ |
||
107 | public function addCategory(CategoryInterface $category) |
||
113 | |||
114 | /** |
||
115 | * returns a new CategoryInterface |
||
116 | * |
||
117 | * @return \FeedIo\Feed\Node\CategoryInterface |
||
118 | */ |
||
119 | public function newCategory() |
||
123 | |||
124 | /** |
||
125 | * @return ElementInterface |
||
126 | */ |
||
127 | public function newElement() |
||
131 | |||
132 | /** |
||
133 | * @param string $name element name |
||
134 | * @return mixed |
||
135 | */ |
||
136 | public function getValue($name) |
||
144 | |||
145 | /** |
||
146 | * @param string $name element name |
||
147 | * @return ElementIterator |
||
148 | */ |
||
149 | public function getElementIterator($name) |
||
153 | |||
154 | /** |
||
155 | * @param string $name element name |
||
156 | * @return boolean true if the element exists |
||
157 | */ |
||
158 | public function hasElement($name) |
||
164 | |||
165 | /** |
||
166 | * @param ElementInterface $element |
||
167 | * @return $this |
||
168 | */ |
||
169 | public function addElement(ElementInterface $element) |
||
175 | |||
176 | /** |
||
177 | * Returns all the item's optional elements |
||
178 | * @return \ArrayIterator |
||
179 | */ |
||
180 | public function getAllElements() |
||
184 | |||
185 | /** |
||
186 | * Returns the item's optional elements tag names |
||
187 | * @return array |
||
188 | */ |
||
189 | public function listElements() |
||
195 | |||
196 | /** |
||
197 | * @return \Generator |
||
198 | */ |
||
199 | public function getElementsGenerator() |
||
207 | |||
208 | /** |
||
209 | * @return string |
||
210 | */ |
||
211 | public function getTitle() |
||
215 | |||
216 | /** |
||
217 | * @param string $title |
||
218 | * @return $this |
||
219 | */ |
||
220 | public function setTitle($title) |
||
226 | |||
227 | /** |
||
228 | * @return string |
||
229 | */ |
||
230 | public function getPublicId() |
||
234 | |||
235 | /** |
||
236 | * @param string $publicId |
||
237 | * @return $this |
||
238 | */ |
||
239 | public function setPublicId($publicId) |
||
245 | |||
246 | /** |
||
247 | * @return string |
||
248 | */ |
||
249 | public function getDescription() |
||
253 | |||
254 | /** |
||
255 | * @param string $description |
||
256 | * @return $this |
||
257 | */ |
||
258 | public function setDescription($description) |
||
264 | |||
265 | /** |
||
266 | * @return \DateTime |
||
267 | */ |
||
268 | public function getLastModified() |
||
272 | |||
273 | /** |
||
274 | * @param \DateTime $lastModified |
||
275 | * @return $this |
||
276 | */ |
||
277 | public function setLastModified(\DateTime $lastModified) |
||
283 | |||
284 | /** |
||
285 | * @return string |
||
286 | */ |
||
287 | public function getLink() |
||
291 | |||
292 | /** |
||
293 | * @param string $link |
||
294 | * @return $this |
||
295 | */ |
||
296 | public function setLink($link) |
||
302 | |||
303 | /** |
||
304 | * @return array |
||
305 | */ |
||
306 | public function toArray() |
||
315 | |||
316 | } |
||
317 |