1 | <?php |
||
10 | final class DataContainer implements DataContainerInterface |
||
11 | { |
||
12 | /** |
||
13 | * The requested offset (number of skipped results) of the call. |
||
14 | * |
||
15 | * @var integer |
||
16 | */ |
||
17 | private $offset; |
||
18 | |||
19 | /** |
||
20 | * The requested result limit. |
||
21 | * |
||
22 | * @var integer |
||
23 | */ |
||
24 | private $limit; |
||
25 | |||
26 | /** |
||
27 | * The total number of resources available given the current filter set. |
||
28 | * |
||
29 | * @var integer |
||
30 | */ |
||
31 | private $total; |
||
32 | |||
33 | /** |
||
34 | * The total number of results returned by this call. |
||
35 | * |
||
36 | * @var integer |
||
37 | */ |
||
38 | private $count; |
||
39 | |||
40 | /** |
||
41 | * The list of creators returned by the call. |
||
42 | * |
||
43 | * @var EntityInterface[] |
||
44 | */ |
||
45 | private $results = []; |
||
46 | |||
47 | /** |
||
48 | * Create a new DataContainer instance. |
||
49 | * |
||
50 | * @param array $input The data for the DataContainer. |
||
51 | */ |
||
52 | public function __construct(array $input) |
||
71 | |||
72 | /** |
||
73 | * Helper method to derive the filter to use for the given resource array |
||
74 | * |
||
75 | * @param mixed $results The results array from the API. |
||
76 | * |
||
77 | * @return callable The filter to use |
||
78 | */ |
||
79 | private static function deriveResourceFilter($results) |
||
94 | |||
95 | /** |
||
96 | * Returns The requested offset (number of skipped results) of the call. |
||
97 | * |
||
98 | * @return integer |
||
99 | */ |
||
100 | public function getOffset() : int |
||
104 | |||
105 | /** |
||
106 | * Returns The requested result limit. |
||
107 | * |
||
108 | * @return integer |
||
109 | */ |
||
110 | public function getLimit() : int |
||
114 | |||
115 | /** |
||
116 | * Returns The total number of resources available given the current filter set. |
||
117 | * |
||
118 | * @return integer |
||
119 | */ |
||
120 | public function getTotal() : int |
||
124 | |||
125 | /** |
||
126 | * Returns The total number of results returned by this call. |
||
127 | * |
||
128 | * @return integer |
||
129 | */ |
||
130 | public function getCount() : int |
||
134 | |||
135 | /** |
||
136 | * Returns The list of creators returned by the call. |
||
137 | * |
||
138 | * @return EntityInterface[] |
||
139 | */ |
||
140 | public function getResults() : array |
||
144 | } |
||
145 |