1 | <?php |
||
7 | class Paginate extends Controller |
||
8 | { |
||
9 | public $perPage, $currentPage, $total , $maxPage , $items , $skip; |
||
|
|||
10 | |||
11 | /** |
||
12 | * Paginate constructor. |
||
13 | */ |
||
14 | public function __construct() |
||
19 | |||
20 | /** |
||
21 | * @return mixed |
||
22 | */ |
||
23 | public function getItems() |
||
27 | |||
28 | /** |
||
29 | * @return mixed |
||
30 | */ |
||
31 | public function getSkip() |
||
35 | |||
36 | /** |
||
37 | * @return mixed |
||
38 | */ |
||
39 | public function getCurrentPage() |
||
43 | |||
44 | /** |
||
45 | * @return mixed |
||
46 | */ |
||
47 | public function getMaxPages() |
||
51 | |||
52 | /** |
||
53 | * @return mixed |
||
54 | */ |
||
55 | public function getPerPage() |
||
59 | |||
60 | /** |
||
61 | * @return mixed |
||
62 | */ |
||
63 | public function getTotal() |
||
67 | |||
68 | /** |
||
69 | * @param $skip |
||
70 | */ |
||
71 | public function setSkip($skip) |
||
75 | |||
76 | /** |
||
77 | * @param $items |
||
78 | */ |
||
79 | public function setItems($items) |
||
87 | |||
88 | /** |
||
89 | * @param $currentPage |
||
90 | */ |
||
91 | public function setCurrentPage($currentPage) |
||
95 | |||
96 | /** |
||
97 | * @param $maxPage |
||
98 | */ |
||
99 | public function setMaxPages($maxPage) |
||
103 | |||
104 | /** |
||
105 | * @param $perPage |
||
106 | */ |
||
107 | public function setPerPage($perPage) |
||
111 | |||
112 | /** |
||
113 | * @param $total |
||
114 | */ |
||
115 | public function setTotal($total) |
||
119 | |||
120 | public function paginate() |
||
143 | } |
||
144 |
Only declaring a single property per statement allows you to later on add doc comments more easily.
It is also recommended by PSR2, so it is a common style that many people expect.