1 | <?php |
||
9 | class Item implements ItemInterface |
||
10 | { |
||
11 | |||
12 | /** @var string */ |
||
13 | protected $title; |
||
14 | |||
15 | /** @var string */ |
||
16 | protected $url; |
||
17 | |||
18 | /** @var string */ |
||
19 | protected $description; |
||
20 | |||
21 | /** @var string */ |
||
22 | protected $content; |
||
23 | |||
24 | /** @var string */ |
||
25 | protected $creator; |
||
26 | |||
27 | /** @var array */ |
||
28 | protected $categories = []; |
||
29 | |||
30 | /** @var string */ |
||
31 | protected $guid; |
||
32 | |||
33 | /** @var bool */ |
||
34 | protected $isPermalink; |
||
35 | |||
36 | /** @var int */ |
||
37 | protected $pubDate; |
||
38 | |||
39 | /** @var array */ |
||
40 | protected $enclosure; |
||
41 | |||
42 | /** |
||
43 | * Set item title |
||
44 | * @param string $title |
||
45 | * @return $this |
||
46 | */ |
||
47 | public function title($title) |
||
53 | |||
54 | /** |
||
55 | * Set item URL |
||
56 | * @param string $url |
||
57 | * @return $this |
||
58 | */ |
||
59 | public function url($url) |
||
65 | |||
66 | /** |
||
67 | * Set item description |
||
68 | * @param string $description |
||
69 | * @return $this |
||
70 | */ |
||
71 | public function description($description) |
||
77 | |||
78 | /** |
||
79 | * Set item category |
||
80 | * @param string $name Category name |
||
81 | * @param string $domain Category URL |
||
82 | * @return $this |
||
83 | */ |
||
84 | public function category($name, $domain = null) |
||
90 | |||
91 | /** |
||
92 | * Set GUID |
||
93 | * @param string $guid |
||
94 | * @param bool $isPermalink |
||
95 | * @return $this |
||
96 | */ |
||
97 | public function guid($guid, $isPermalink = false) |
||
104 | |||
105 | /** |
||
106 | * Set published date |
||
107 | * @param int $pubDate Unix timestamp |
||
108 | * @return $this |
||
109 | */ |
||
110 | public function pubDate($pubDate) |
||
116 | |||
117 | /** |
||
118 | * Set enclosure |
||
119 | * @param string $url Url to media file |
||
120 | * @param int $length Length in bytes of the media file |
||
121 | * @param string $type Media type, default is audio/mpeg |
||
122 | * @return $this |
||
123 | */ |
||
124 | public function enclosure($url, $length = 0, $type = 'audio/mpeg') |
||
130 | |||
131 | /** |
||
132 | * Append item to the channel |
||
133 | * @param ChannelInterface $channel |
||
134 | * @return $this |
||
135 | */ |
||
136 | public function appendTo(ChannelInterface $channel) |
||
142 | |||
143 | /** |
||
144 | * Set author name for article |
||
145 | * |
||
146 | * @param $creator |
||
147 | * @return $this |
||
148 | */ |
||
149 | public function creator($creator) |
||
155 | |||
156 | /** |
||
157 | * @param $content |
||
158 | * @return $this |
||
159 | */ |
||
160 | public function content($content) |
||
166 | |||
167 | /** |
||
168 | * Return XML object |
||
169 | * @return SimpleXMLElement |
||
170 | */ |
||
171 | public function asXML() |
||
215 | } |
||
216 |