1 | <?php |
||
8 | class PaginationFilter implements FilterInterface |
||
9 | { |
||
10 | /** @var int $page */ |
||
11 | private $page; |
||
12 | |||
13 | /** @var int $numPerPage */ |
||
14 | private $numPerPage; |
||
15 | |||
16 | /** |
||
17 | * @param ArrayIterator $collection |
||
18 | * @return ArrayIterator |
||
19 | */ |
||
20 | 2 | public function filter(ArrayIterator $collection): ArrayIterator |
|
39 | |||
40 | 1 | private function getResults(ArrayIterator $collection, int $totalRecords, int $resultsOffset, int $resultsEndOffset) |
|
57 | |||
58 | |||
59 | /** |
||
60 | * @return int |
||
61 | */ |
||
62 | 1 | public function getPage(): int |
|
66 | |||
67 | /** |
||
68 | * @param int $page |
||
69 | * @return PaginationFilter |
||
70 | */ |
||
71 | 1 | public function setPage(int $page): PaginationFilter |
|
76 | |||
77 | /** |
||
78 | * @return int |
||
79 | */ |
||
80 | 1 | public function getNumPerPage(): int |
|
84 | |||
85 | /** |
||
86 | * @param int $numPerPage |
||
87 | * @return PaginationFilter |
||
88 | */ |
||
89 | 1 | public function setNumPerPage(int $numPerPage): PaginationFilter |
|
94 | } |