1 | <?php |
||
10 | class Pagination { |
||
|
|||
11 | |||
12 | /** |
||
13 | * @access public |
||
14 | * @var integer Current Page |
||
15 | */ |
||
16 | public $currentPage; |
||
17 | |||
18 | /** |
||
19 | * @access public |
||
20 | * @var integer Number of items(newsfeed, posts, ..etc.) to be displayed per page |
||
21 | */ |
||
22 | public $perPage; |
||
23 | |||
24 | /** |
||
25 | * @access public |
||
26 | * @var integer Total count of items(newsfeed, posts, ..etc.) |
||
27 | */ |
||
28 | public $totalCount; |
||
29 | |||
30 | /** |
||
31 | * This is the constructor for Pagination Object. |
||
32 | * |
||
33 | * @access public |
||
34 | * @param integer $currentPage |
||
35 | * @param integer $totalCount |
||
36 | * @param integer $perPage Number of items per page |
||
37 | */ |
||
38 | public function __construct($currentPage = 1, $totalCount = 0, $perPage = 0){ |
||
43 | |||
44 | /** |
||
45 | * get pagination object by executing COUNT(*) query. |
||
46 | * |
||
47 | * @access public |
||
48 | * @param string $table |
||
49 | * @param string $options |
||
50 | * @param array $values array of data |
||
51 | * @param integer $pageNum |
||
52 | * @param integer $extraOffset check comment class |
||
53 | * @return Pagination |
||
54 | */ |
||
55 | public static function pagination($table, $options, $values, $pageNum, $extraOffset = 0){ |
||
68 | |||
69 | /** |
||
70 | * Get the offset. |
||
71 | * |
||
72 | * @access public |
||
73 | * @return integer |
||
74 | */ |
||
75 | public function getOffset() { |
||
78 | |||
79 | /** |
||
80 | * Get number of total pages. |
||
81 | * |
||
82 | * @access public |
||
83 | * @return integer |
||
84 | */ |
||
85 | public function totalPages() { |
||
88 | |||
89 | /** |
||
90 | * Get the number of the previous page. |
||
91 | * |
||
92 | * @access public |
||
93 | * @return integer Number of previous page |
||
94 | */ |
||
95 | public function previousPage() { |
||
98 | |||
99 | /** |
||
100 | * Get the number of the next page. |
||
101 | * |
||
102 | * @access public |
||
103 | * @return integer Number of next page |
||
104 | */ |
||
105 | public function nextPage() { |
||
108 | |||
109 | /** |
||
110 | * checks if there is a previous page or not |
||
111 | * |
||
112 | * @access public |
||
113 | * @return boolean |
||
114 | */ |
||
115 | public function hasPreviousPage() { |
||
118 | |||
119 | /** |
||
120 | * checks if there is a next page or not |
||
121 | * |
||
122 | * @access public |
||
123 | * @return boolean |
||
124 | */ |
||
125 | public function hasNextPage() { |
||
128 | |||
129 | } |
||
130 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.