1 | <?php |
||
23 | class DoctrinePaginatorAdapter implements PaginatorInterface |
||
24 | { |
||
25 | /** |
||
26 | * The paginator instance. |
||
27 | * @var Paginator<mixed> |
||
28 | */ |
||
29 | private $paginator; |
||
30 | |||
31 | /** |
||
32 | * The route generator. |
||
33 | * |
||
34 | * @var callable |
||
35 | */ |
||
36 | private $routeGenerator; |
||
37 | |||
38 | /** |
||
39 | * Create a new DoctrinePaginatorAdapter. |
||
40 | * @param Paginator<mixed> $paginator |
||
|
|||
41 | * @param callable $routeGenerator |
||
42 | * |
||
43 | */ |
||
44 | 1 | public function __construct(Paginator $paginator, callable $routeGenerator) |
|
49 | |||
50 | /** |
||
51 | * Get the current page. |
||
52 | * |
||
53 | * @return int |
||
54 | */ |
||
55 | 1 | public function getCurrentPage() |
|
59 | |||
60 | /** |
||
61 | * Get the last page. |
||
62 | * |
||
63 | * @return int |
||
64 | */ |
||
65 | 1 | public function getLastPage() |
|
69 | |||
70 | /** |
||
71 | * Get the total. |
||
72 | * |
||
73 | * @return int |
||
74 | */ |
||
75 | 1 | public function getTotal() |
|
79 | |||
80 | /** |
||
81 | * Get the count. |
||
82 | * |
||
83 | * @return int |
||
84 | * |
||
85 | * @throws Exception If the iterator cannot be resolved |
||
86 | * @throws RuntimeException If the returned iterator can't be counted |
||
87 | */ |
||
88 | 1 | public function getCount() |
|
96 | |||
97 | /** |
||
98 | * Get the number per page. |
||
99 | * |
||
100 | * @return int |
||
101 | */ |
||
102 | 1 | public function getPerPage() |
|
106 | |||
107 | /** |
||
108 | * Get the url for the given page. |
||
109 | * |
||
110 | * @param int $page |
||
111 | * |
||
112 | * @return string |
||
113 | */ |
||
114 | 1 | public function getUrl($page) |
|
118 | |||
119 | /** |
||
120 | * Get the the route generator. |
||
121 | * |
||
122 | * @return callable |
||
123 | */ |
||
124 | 1 | private function getRouteGenerator() |
|
128 | } |
||
129 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.