1 | <?php |
||
6 | class Page { |
||
7 | /** |
||
8 | * set the number of items per page. |
||
9 | * |
||
10 | * @var numeric |
||
11 | */ |
||
12 | private $_perPage; |
||
13 | |||
14 | /** |
||
15 | * set get parameter for fetching the page number |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | private $_instance; |
||
20 | |||
21 | /** |
||
22 | * sets the page number. |
||
23 | * |
||
24 | * @var numeric |
||
25 | */ |
||
26 | private $_page; |
||
27 | |||
28 | /** |
||
29 | * set the limit for the data source |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | private $_limit; |
||
|
|||
34 | |||
35 | /** |
||
36 | * set the total number of records/items. |
||
37 | * |
||
38 | * @var numeric |
||
39 | */ |
||
40 | private $_totalRows=0; |
||
41 | |||
42 | |||
43 | |||
44 | /** |
||
45 | * __construct |
||
46 | * |
||
47 | * pass values when class is istantiated |
||
48 | * |
||
49 | * @param numeric $perPage sets the number of iteems per page |
||
50 | * @param numeric $instance sets the instance for the GET parameter |
||
51 | */ |
||
52 | public function __construct($perPage, $instance) { |
||
57 | |||
58 | /** |
||
59 | * get_start |
||
60 | * |
||
61 | * creates the starting point for limiting the dataset |
||
62 | * @return numeric |
||
63 | */ |
||
64 | public function get_start() { |
||
67 | |||
68 | /** |
||
69 | * set_instance |
||
70 | * |
||
71 | * sets the instance parameter, if numeric value is 0 then set to 1 |
||
72 | * |
||
73 | * @var numeric |
||
74 | */ |
||
75 | private function set_instance() { |
||
79 | |||
80 | /** |
||
81 | * set_total |
||
82 | * |
||
83 | * collect a numberic value and assigns it to the totalRows |
||
84 | * |
||
85 | * @var numeric |
||
86 | */ |
||
87 | public function set_total($_totalRows) { |
||
90 | |||
91 | /** |
||
92 | * get_limit |
||
93 | * |
||
94 | * returns the limit for the data source, calling the get_start method and passing in the number of items perp page |
||
95 | * |
||
96 | * @return string |
||
97 | */ |
||
98 | public function get_limit() { |
||
101 | |||
102 | |||
103 | private function getParam() { |
||
112 | |||
113 | /** |
||
114 | * page_links |
||
115 | * |
||
116 | * create the html links for navigating through the dataset |
||
117 | * |
||
118 | * @var sting $path optionally set the path for the link |
||
119 | * @var sting $ext optionally pass in extra parameters to the GET |
||
120 | * @return string returns the html menu |
||
121 | */ |
||
122 | public function page_links($path='?', $ext=null) |
||
210 | } |
This check marks private properties in classes that are never used. Those properties can be removed.