1 | <?php |
||
10 | final class CallbackPage implements Page |
||
11 | { |
||
12 | private $resultCallback; |
||
13 | private $totalCountCallback; |
||
14 | private $offset; |
||
15 | private $limit; |
||
16 | private $totalCount; |
||
17 | private $results; |
||
18 | |||
19 | public function __construct(callable $resultCallback, callable $totalCountCallback, $offset, $limit) |
||
26 | |||
27 | /** |
||
28 | * {@inheritdoc} |
||
29 | */ |
||
30 | public function getCurrentOffset() |
||
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | public function getCurrentPage() |
||
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | public function getCurrentLimit() |
||
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | public function count() |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function totalCount() |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function getIterator() |
||
78 | |||
79 | /** |
||
80 | * @return \ArrayIterator |
||
81 | */ |
||
82 | private function getResults() |
||
90 | } |
||
91 |