1 | <?php |
||
8 | class Item |
||
9 | { |
||
10 | /** @var string */ |
||
11 | private $id; |
||
12 | |||
13 | /** @var string */ |
||
14 | private $url; |
||
15 | |||
16 | /** @var string */ |
||
17 | private $externalUrl; |
||
18 | |||
19 | /** @var string */ |
||
20 | private $title; |
||
21 | |||
22 | /** @var string */ |
||
23 | private $contentHtml; |
||
24 | |||
25 | /** @var string */ |
||
26 | private $contentText; |
||
27 | |||
28 | /** @var string */ |
||
29 | private $summary; |
||
30 | |||
31 | /** @var string */ |
||
32 | private $image; |
||
33 | |||
34 | /** @var string */ |
||
35 | private $bannerImage; |
||
36 | |||
37 | /** @var DateTime */ |
||
38 | private $datePublished; |
||
39 | |||
40 | /** @var DateTime */ |
||
41 | private $dateModified; |
||
42 | |||
43 | /** @var Author */ |
||
44 | private $author; |
||
45 | |||
46 | /** @var string[] */ |
||
47 | private $tags; |
||
48 | |||
49 | /** @var Attachment[] */ |
||
50 | private $attachments; |
||
51 | |||
52 | /** @var array */ |
||
53 | private $extensions; |
||
54 | |||
55 | /** |
||
56 | * Constructor |
||
57 | * |
||
58 | * @param string $id |
||
59 | */ |
||
60 | public function __construct($id) |
||
68 | |||
69 | /** |
||
70 | * Get unique identifer for that item for that feed over time |
||
71 | * |
||
72 | * @return string |
||
73 | */ |
||
74 | public function getId() |
||
78 | |||
79 | /** |
||
80 | * Get the URL of the resource described by the item |
||
81 | * |
||
82 | * @return string |
||
83 | */ |
||
84 | public function getUrl() |
||
88 | |||
89 | /** |
||
90 | * Set the URL of the resource described by the item |
||
91 | * |
||
92 | * @param string $url |
||
93 | * @return Item |
||
94 | */ |
||
95 | public function setUrl($url) |
||
101 | |||
102 | /** |
||
103 | * Get the URL of a page elsewhere |
||
104 | * |
||
105 | * @return string |
||
106 | */ |
||
107 | public function getExternalUrl() |
||
111 | |||
112 | /** |
||
113 | * Set the URL of a page elsewhere |
||
114 | * |
||
115 | * @param string $externalUrl |
||
116 | * @return Item |
||
117 | */ |
||
118 | public function setExternalUrl($externalUrl) |
||
124 | |||
125 | /** |
||
126 | * Get plaintext title |
||
127 | * |
||
128 | * @return string |
||
129 | */ |
||
130 | public function getTitle() |
||
134 | |||
135 | /** |
||
136 | * Set plaintext title |
||
137 | * |
||
138 | * @param string $title |
||
139 | * @return Item |
||
140 | */ |
||
141 | public function setTitle($title) |
||
147 | |||
148 | /** |
||
149 | * Get the HTML content for the item |
||
150 | * |
||
151 | * @return string |
||
152 | */ |
||
153 | public function getContentHtml() |
||
157 | |||
158 | /** |
||
159 | * Set the HTML content for the item |
||
160 | * |
||
161 | * @param string $contentHtml |
||
162 | * @return Item |
||
163 | */ |
||
164 | public function setContentHtml($contentHtml) |
||
170 | |||
171 | /** |
||
172 | * Get plain text content for the item |
||
173 | * |
||
174 | * @return string |
||
175 | */ |
||
176 | public function getContentText() |
||
180 | |||
181 | /** |
||
182 | * Set plain text content for the item |
||
183 | * |
||
184 | * @param string $contentText |
||
185 | * @return Item |
||
186 | */ |
||
187 | public function setContentText($contentText) |
||
193 | |||
194 | /** |
||
195 | * Get a plain text sentence or two describing the item |
||
196 | * |
||
197 | * @return string |
||
198 | */ |
||
199 | public function getSummary() |
||
203 | |||
204 | /** |
||
205 | * Set a plain text sentence or two describing the item |
||
206 | * |
||
207 | * @param string $summary |
||
208 | * @return Item |
||
209 | */ |
||
210 | public function setSummary($summary) |
||
216 | |||
217 | /** |
||
218 | * Get the URL of the main image for the item |
||
219 | * |
||
220 | * @return string |
||
221 | */ |
||
222 | public function getImage() |
||
226 | |||
227 | /** |
||
228 | * Set the URL of the main image for the item |
||
229 | * |
||
230 | * @param string $image |
||
231 | * @return Item |
||
232 | */ |
||
233 | public function setImage($image) |
||
239 | |||
240 | /** |
||
241 | * Get the URL of an image to use as a banner |
||
242 | * |
||
243 | * @return string |
||
244 | */ |
||
245 | public function getBannerImage() |
||
249 | |||
250 | /** |
||
251 | * Set the URL of an image to use as a banner |
||
252 | * |
||
253 | * @param string $bannerImage |
||
254 | * @return Item |
||
255 | */ |
||
256 | public function setBannerImage($bannerImage) |
||
262 | |||
263 | /** |
||
264 | * Get the item published date |
||
265 | * |
||
266 | * @return DateTime |
||
267 | */ |
||
268 | public function getDatePublished() |
||
272 | |||
273 | /** |
||
274 | * Set the item published date |
||
275 | * |
||
276 | * @param DateTime $datePublished |
||
277 | * @return Item |
||
278 | */ |
||
279 | public function setDatePublished(DateTime $datePublished) |
||
285 | |||
286 | /** |
||
287 | * Get the item modified date |
||
288 | * |
||
289 | * @return DateTime |
||
290 | */ |
||
291 | public function getDateModified() |
||
295 | |||
296 | /** |
||
297 | * Set the item modified date |
||
298 | * |
||
299 | * @param DateTime $dateModified |
||
300 | * @return Item |
||
301 | */ |
||
302 | public function setDateModified(DateTime $dateModified) |
||
308 | |||
309 | /** |
||
310 | * Get item author |
||
311 | * |
||
312 | * @return Author |
||
313 | */ |
||
314 | public function getAuthor() |
||
318 | |||
319 | /** |
||
320 | * Set item author |
||
321 | * |
||
322 | * @param Author $author |
||
323 | * @return Item |
||
324 | */ |
||
325 | public function setAuthor(Author $author) |
||
331 | |||
332 | /** |
||
333 | * Get item tags |
||
334 | * |
||
335 | * @return string[] |
||
336 | */ |
||
337 | public function getTags() |
||
341 | |||
342 | /** |
||
343 | * Add item tag |
||
344 | * @param string $tag |
||
345 | * @return Item |
||
346 | */ |
||
347 | public function addTag($tag) |
||
355 | |||
356 | /** |
||
357 | * Set item tags |
||
358 | * |
||
359 | * @param string[] $tags |
||
360 | * @return Item |
||
361 | */ |
||
362 | public function setTags(array $tags) |
||
368 | |||
369 | /** |
||
370 | * Get item attachments |
||
371 | * |
||
372 | * @return Attachment[] |
||
373 | */ |
||
374 | public function getAttachments() |
||
378 | |||
379 | /** |
||
380 | * Add item attachment |
||
381 | * |
||
382 | * @param Attachment $attachment |
||
383 | * @return Item |
||
384 | */ |
||
385 | public function addAttachment(Attachment $attachment) |
||
393 | |||
394 | /** |
||
395 | * Set item attachments |
||
396 | * |
||
397 | * @param Attachment[] $attachments |
||
398 | * @return Item |
||
399 | */ |
||
400 | public function setAttachments(array $attachments) |
||
406 | |||
407 | /** |
||
408 | * Add an extension to the item |
||
409 | * |
||
410 | * @param string $key |
||
411 | * @param array $value |
||
412 | * @return Item |
||
413 | */ |
||
414 | public function addExtension($key, array $value) |
||
424 | |||
425 | /** |
||
426 | * Get all extensions |
||
427 | * |
||
428 | * @return array |
||
429 | */ |
||
430 | public function getExtensions() |
||
434 | |||
435 | /** |
||
436 | * Get an extension |
||
437 | * |
||
438 | * @param string $key |
||
439 | * @return array|null |
||
440 | */ |
||
441 | public function getExtension($key) |
||
449 | } |
||
450 |