1 | <?php |
||
16 | class Node implements NodeInterface, ElementsAwareInterface |
||
17 | { |
||
18 | use ElementsAwareTrait; |
||
19 | |||
20 | /** |
||
21 | * @var \ArrayIterator |
||
22 | */ |
||
23 | protected $categories; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $title; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $publicId; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $description; |
||
39 | |||
40 | /** |
||
41 | * @var \DateTime |
||
42 | */ |
||
43 | protected $lastModified; |
||
44 | |||
45 | /** |
||
46 | * @var string |
||
47 | */ |
||
48 | protected $link; |
||
49 | |||
50 | 91 | public function __construct() |
|
55 | |||
56 | /** |
||
57 | * @param string $name element name |
||
58 | * @param string $value element value |
||
59 | * @return $this |
||
60 | */ |
||
61 | 10 | public function set($name, $value) |
|
72 | |||
73 | /** |
||
74 | * returns node's categories |
||
75 | * |
||
76 | * @return \ArrayIterator |
||
77 | */ |
||
78 | 9 | public function getCategories() |
|
82 | |||
83 | /** |
||
84 | * @return \Generator |
||
85 | */ |
||
86 | 4 | public function getCategoriesGenerator() |
|
92 | |||
93 | /** |
||
94 | * adds a category to the node |
||
95 | * |
||
96 | * @param \FeedIo\Feed\Node\CategoryInterface $category |
||
97 | * @return $this |
||
98 | */ |
||
99 | 11 | public function addCategory(CategoryInterface $category) |
|
105 | |||
106 | /** |
||
107 | * returns a new CategoryInterface |
||
108 | * |
||
109 | * @return \FeedIo\Feed\Node\CategoryInterface |
||
110 | */ |
||
111 | 5 | public function newCategory() |
|
115 | |||
116 | /** |
||
117 | * @return string |
||
118 | */ |
||
119 | 16 | public function getTitle() |
|
123 | |||
124 | /** |
||
125 | * @param string $title |
||
126 | * @return $this |
||
127 | */ |
||
128 | 18 | public function setTitle($title) |
|
134 | |||
135 | /** |
||
136 | * @return string |
||
137 | */ |
||
138 | 8 | public function getPublicId() |
|
142 | |||
143 | /** |
||
144 | * @param string $publicId |
||
145 | * @return $this |
||
146 | */ |
||
147 | 10 | public function setPublicId($publicId) |
|
153 | |||
154 | /** |
||
155 | * @return string |
||
156 | */ |
||
157 | 9 | public function getDescription() |
|
161 | |||
162 | /** |
||
163 | * @param string $description |
||
164 | * @return $this |
||
165 | */ |
||
166 | 12 | public function setDescription($description) |
|
172 | |||
173 | /** |
||
174 | * @return \DateTime |
||
175 | */ |
||
176 | 14 | public function getLastModified() |
|
180 | |||
181 | /** |
||
182 | * @param \DateTime $lastModified |
||
183 | * @return $this |
||
184 | */ |
||
185 | 18 | public function setLastModified(\DateTime $lastModified) |
|
191 | |||
192 | /** |
||
193 | * @return string |
||
194 | */ |
||
195 | 13 | public function getLink() |
|
199 | |||
200 | /** |
||
201 | * @param string $link |
||
202 | * @return $this |
||
203 | */ |
||
204 | 15 | public function setLink($link) |
|
210 | |||
211 | /** |
||
212 | * @param string $name element name |
||
213 | * @return mixed |
||
214 | */ |
||
215 | 4 | public function getValue($name) |
|
223 | |||
224 | /** |
||
225 | * @return array |
||
226 | */ |
||
227 | 3 | public function toArray() |
|
242 | |||
243 | } |
||
244 |