1 | <?php |
||
20 | class EntryCollection implements ResponseInterface, \IteratorAggregate, \ArrayAccess, \Countable |
||
21 | { |
||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $items = []; |
||
26 | |||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | protected $rawData = []; |
||
31 | |||
32 | /** |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $metadata = []; |
||
36 | |||
37 | /** |
||
38 | * EntryCollection constructor. |
||
39 | * |
||
40 | * @param $data |
||
41 | */ |
||
42 | 8 | public function __construct($data) |
|
55 | |||
56 | /** |
||
57 | * Get the response raw data |
||
58 | * |
||
59 | * @return array |
||
60 | */ |
||
61 | 2 | public function getRawData() |
|
65 | |||
66 | /** |
||
67 | * Get the response entries |
||
68 | * |
||
69 | * @return array |
||
70 | */ |
||
71 | 2 | public function getData() |
|
75 | |||
76 | /** |
||
77 | * Get the response metadata |
||
78 | * |
||
79 | * @return array |
||
80 | */ |
||
81 | 2 | public function getMetaData() |
|
85 | |||
86 | /** |
||
87 | * Create a new iterator based on this collection |
||
88 | * |
||
89 | * @return \ArrayIterator |
||
90 | */ |
||
91 | 2 | public function getIterator() |
|
95 | |||
96 | public function offsetExists($offset) |
||
100 | |||
101 | public function offsetGet($offset) |
||
105 | |||
106 | public function offsetSet($offset, $value) |
||
110 | |||
111 | public function offsetUnset($offset) |
||
115 | |||
116 | /** |
||
117 | * Gets the number of entries in this collection |
||
118 | * |
||
119 | * @return int |
||
120 | */ |
||
121 | 2 | public function count() |
|
125 | |||
126 | /** |
||
127 | * Gets an object representation of this collection |
||
128 | * |
||
129 | * @return object |
||
130 | */ |
||
131 | 2 | public function jsonSerialize() |
|
138 | } |