1 | <?php |
||
17 | class Feed extends Node implements FeedInterface, \JsonSerializable |
||
18 | { |
||
19 | /** |
||
20 | * @var \ArrayIterator |
||
21 | */ |
||
22 | protected $items; |
||
23 | |||
24 | /** |
||
25 | * @var string $url |
||
26 | */ |
||
27 | protected $url; |
||
28 | |||
29 | 33 | public function __construct() |
|
30 | { |
||
31 | 33 | $this->items = new \ArrayIterator(); |
|
32 | |||
33 | 33 | parent::__construct(); |
|
34 | 33 | } |
|
35 | |||
36 | /** |
||
37 | * @return string $url |
||
38 | */ |
||
39 | 1 | public function getUrl() |
|
40 | { |
||
41 | 1 | return $this->url; |
|
42 | } |
||
43 | |||
44 | /** |
||
45 | * @param string $url |
||
46 | * @return FeedInterface |
||
47 | */ |
||
48 | 1 | public function setUrl($url) |
|
49 | { |
||
50 | 1 | $this->url = $url; |
|
51 | |||
52 | 1 | return $this; |
|
53 | } |
||
54 | |||
55 | /** |
||
56 | * (PHP 5 >= 5.0.0)<br/> |
||
57 | * Return the current element |
||
58 | * @link http://php.net/manual/en/iterator.current.php |
||
59 | * @return mixed Can return any type. |
||
60 | */ |
||
61 | 14 | public function current() |
|
65 | |||
66 | /** |
||
67 | * (PHP 5 >= 5.0.0)<br/> |
||
68 | * Move forward to next element |
||
69 | * @link http://php.net/manual/en/iterator.next.php |
||
70 | * @return void Any returned value is ignored. |
||
71 | */ |
||
72 | 12 | public function next() |
|
76 | |||
77 | /** |
||
78 | * (PHP 5 >= 5.0.0)<br/> |
||
79 | * Return the key of the current element |
||
80 | * @link http://php.net/manual/en/iterator.key.php |
||
81 | * @return mixed scalar on success, or null on failure. |
||
82 | */ |
||
83 | 1 | public function key() |
|
87 | |||
88 | /** |
||
89 | * (PHP 5 >= 5.0.0)<br/> |
||
90 | * Checks if current position is valid |
||
91 | * @link http://php.net/manual/en/iterator.valid.php |
||
92 | * @return boolean The return value will be casted to boolean and then evaluated. |
||
93 | * Returns true on success or false on failure. |
||
94 | */ |
||
95 | 15 | public function valid() |
|
99 | |||
100 | /** |
||
101 | * (PHP 5 >= 5.0.0)<br/> |
||
102 | * Rewind the Iterator to the first element |
||
103 | * @link http://php.net/manual/en/iterator.rewind.php |
||
104 | * @return void Any returned value is ignored. |
||
105 | */ |
||
106 | 13 | public function rewind() |
|
110 | |||
111 | /** |
||
112 | * @param ItemInterface $item |
||
113 | * @return $this |
||
114 | */ |
||
115 | 19 | public function add(ItemInterface $item) |
|
121 | |||
122 | /** |
||
123 | * @return ItemInterface |
||
124 | */ |
||
125 | 6 | public function newItem() |
|
129 | |||
130 | /** |
||
131 | * @return array |
||
132 | */ |
||
133 | 1 | public function jsonSerialize() |
|
137 | |||
138 | /** |
||
139 | * @return array |
||
140 | */ |
||
141 | 2 | public function toArray() |
|
154 | } |
||
155 |