1 | <?php |
||
22 | abstract class PaginatorAbstract |
||
23 | { |
||
24 | protected $range = 5; |
||
25 | protected $currentPageNumber; |
||
26 | protected $numItemsPerPage; |
||
27 | protected $totalCount; |
||
28 | |||
29 | public function setCurrentPageNumber($pageNumber) |
||
33 | |||
34 | /** |
||
35 | * Get currently used page number. |
||
36 | * |
||
37 | * @return int |
||
38 | */ |
||
39 | public function getCurrentPageNumber() |
||
43 | |||
44 | public function setItemNumberPerPage($numItemsPerPage) |
||
48 | |||
49 | /** |
||
50 | * Get number of items per page. |
||
51 | * |
||
52 | * @return int |
||
53 | */ |
||
54 | public function getItemNumberPerPage() |
||
58 | |||
59 | public function setTotalItemCount($numTotal) |
||
63 | |||
64 | /** |
||
65 | * Get total item number available. |
||
66 | * |
||
67 | * @return int |
||
68 | */ |
||
69 | public function getTotalItemCount() |
||
73 | |||
74 | /** |
||
75 | * Offsets the result list by the number of places set by the count;. |
||
76 | * |
||
77 | * This would be used for pagination through results, where if you have 20 |
||
78 | * results per 'page', the second page would begin at offset 20, the third |
||
79 | * page at offset 40, etc. |
||
80 | * |
||
81 | * @return int |
||
82 | */ |
||
83 | public function getOffset() |
||
87 | |||
88 | /** |
||
89 | * Processa os valors de resultado. |
||
90 | * |
||
91 | * @param int $numTotal |
||
92 | * @param int $page |
||
93 | * @param int $limit |
||
94 | */ |
||
95 | public function paginate($numTotal, $page, $limit = 10) |
||
101 | |||
102 | public function getPagesCount() |
||
106 | |||
107 | /** |
||
108 | * Pagination page range. |
||
109 | * |
||
110 | * @param int $range |
||
111 | */ |
||
112 | public function setPageRange($range) |
||
116 | |||
117 | /** |
||
118 | * Pagination page range. |
||
119 | * |
||
120 | * @return int |
||
121 | */ |
||
122 | public function getPageRange() |
||
126 | } |
||
127 |