Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | /** |
3 | * Pop PHP Framework (http://www.popphp.org/) |
4 | * |
5 | * @link https://github.com/popphp/popphp-framework |
6 | * @author Nick Sagona, III <dev@nolainteractive.com> |
7 | * @copyright Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com) |
8 | * @license http://www.popphp.org/license New BSD License |
9 | */ |
10 | |
11 | /** |
12 | * @namespace |
13 | */ |
14 | namespace Pop\Paginator; |
15 | |
16 | /** |
17 | * Paginator interface |
18 | * |
19 | * @category Pop |
20 | * @package Pop\Paginator |
21 | * @author Nick Sagona, III <dev@nolainteractive.com> |
22 | * @copyright Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com) |
23 | * @license http://www.popphp.org/license New BSD License |
24 | * @version 4.0.0 |
25 | */ |
26 | interface PaginatorInterface |
27 | { |
28 | |
29 | /** |
30 | * Set the query key |
31 | * |
32 | * @param string $key |
33 | * @return PaginatorInterface |
34 | */ |
35 | public function setQueryKey(string $key): PaginatorInterface; |
36 | |
37 | /** |
38 | * Set the bookends |
39 | * |
40 | * @param array $bookends |
41 | * @return PaginatorInterface |
42 | */ |
43 | public function setBookends(array $bookends): PaginatorInterface; |
44 | |
45 | /** |
46 | * Get the content items total |
47 | * |
48 | * @return int |
49 | */ |
50 | public function getTotal(): int; |
51 | |
52 | /** |
53 | * Get the per page |
54 | * |
55 | * @return int |
56 | */ |
57 | public function getPerPage(): int; |
58 | |
59 | /** |
60 | * Get the page range |
61 | * |
62 | * @return int |
63 | */ |
64 | public function getRange(): int; |
65 | |
66 | /** |
67 | * Get the query key |
68 | * |
69 | * @return string |
70 | */ |
71 | public function getQueryKey(): string; |
72 | |
73 | /** |
74 | * Get the current page |
75 | * |
76 | * @return int |
77 | */ |
78 | public function getCurrentPage(): int; |
79 | |
80 | /** |
81 | * Get the number of pages |
82 | * |
83 | * @return int |
84 | */ |
85 | public function getNumberOfPages(): int; |
86 | |
87 | /** |
88 | * Get a bookend |
89 | * |
90 | * @param string $key |
91 | * @return string|null |
92 | */ |
93 | public function getBookend(string $key): string|null; |
94 | |
95 | /** |
96 | * Get the bookends |
97 | * |
98 | * @return array |
99 | */ |
100 | public function getBookends(): array; |
101 | |
102 | /** |
103 | * Calculate the page range |
104 | * |
105 | * @param int $page |
106 | * @return array |
107 | */ |
108 | public function calculateRange(int $page = 1): array; |
109 | |
110 | } |