1 | <?php |
||
20 | class EntryCollection implements ResponseInterface, \IteratorAggregate , \Countable |
||
21 | { |
||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $items = []; |
||
26 | |||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | protected $data = []; |
||
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 | /** |
||
97 | * Gets the number of entries in this collection |
||
98 | * |
||
99 | * @return int |
||
100 | */ |
||
101 | 2 | public function count() |
|
105 | |||
106 | /** |
||
107 | * Gets an object representation of this collection |
||
108 | * |
||
109 | * @return object |
||
110 | */ |
||
111 | 2 | public function jsonSerialize() |
|
118 | } |