1 | <?php |
||
21 | class DoctrinePaginatorAdapter implements PaginatorInterface |
||
22 | { |
||
23 | /** |
||
24 | * The paginator instance. |
||
25 | * @var Paginator |
||
26 | */ |
||
27 | private $paginator; |
||
28 | |||
29 | /** |
||
30 | * The route generator. |
||
31 | * |
||
32 | * @var callable |
||
33 | */ |
||
34 | private $routeGenerator; |
||
35 | |||
36 | /** |
||
37 | * Create a new DoctrinePaginatorAdapter. |
||
38 | * @param Paginator $paginator |
||
39 | * @param callable $routeGenerator |
||
40 | * |
||
41 | */ |
||
42 | 1 | public function __construct(Paginator $paginator, callable $routeGenerator) |
|
47 | |||
48 | /** |
||
49 | * Get the current page. |
||
50 | * |
||
51 | * @return int |
||
52 | */ |
||
53 | 1 | public function getCurrentPage() |
|
57 | |||
58 | /** |
||
59 | * Get the last page. |
||
60 | * |
||
61 | * @return int |
||
62 | */ |
||
63 | 1 | public function getLastPage() |
|
67 | |||
68 | /** |
||
69 | * Get the total. |
||
70 | * |
||
71 | * @return int |
||
72 | */ |
||
73 | 1 | public function getTotal() |
|
77 | |||
78 | /** |
||
79 | * Get the count. |
||
80 | * |
||
81 | * @return int |
||
82 | */ |
||
83 | 1 | public function getCount() |
|
87 | |||
88 | /** |
||
89 | * Get the number per page. |
||
90 | * |
||
91 | * @return int |
||
92 | */ |
||
93 | 1 | public function getPerPage() |
|
97 | |||
98 | /** |
||
99 | * Get the url for the given page. |
||
100 | * |
||
101 | * @param int $page |
||
102 | * |
||
103 | * @return string |
||
104 | */ |
||
105 | 1 | public function getUrl($page) |
|
109 | |||
110 | /** |
||
111 | * Get the the route generator. |
||
112 | * |
||
113 | * @return callable |
||
114 | */ |
||
115 | 1 | private function getRouteGenerator() |
|
119 | } |
||
120 |