1 | <?php |
||
35 | class PaginationView |
||
36 | { |
||
37 | |||
38 | /** |
||
39 | * @var string template path |
||
40 | */ |
||
41 | protected $template = 'EXT:crawler/template/pagination.php'; |
||
42 | |||
43 | /** |
||
44 | * @var int $perpage number of items perPage |
||
45 | */ |
||
46 | protected $perPage; |
||
47 | |||
48 | /** |
||
49 | * @var int $currentOffset current offset |
||
50 | */ |
||
51 | protected $currentOffset; |
||
52 | |||
53 | /** |
||
54 | * @var int $totalItemCount number of total item |
||
55 | */ |
||
56 | protected $totalItemCount; |
||
57 | |||
58 | /** |
||
59 | * @var string $baseUrl |
||
60 | */ |
||
61 | protected $baseUrl; |
||
62 | |||
63 | /** |
||
64 | * Method to render the view. |
||
65 | * |
||
66 | * @return string html content |
||
67 | */ |
||
68 | public function render() |
||
78 | |||
79 | /** |
||
80 | * Returns the currently configured offset- |
||
81 | * @return int |
||
82 | */ |
||
83 | public function getCurrentOffset() |
||
87 | |||
88 | /** |
||
89 | * Method to read the number of items per page |
||
90 | * |
||
91 | * @return int |
||
92 | */ |
||
93 | public function getPerPage() |
||
97 | |||
98 | /** |
||
99 | * Method to set the current offset from start |
||
100 | * |
||
101 | * @param int $currentOffset |
||
102 | */ |
||
103 | public function setCurrentOffset($currentOffset) |
||
107 | |||
108 | /** |
||
109 | * Number of items per page. |
||
110 | * |
||
111 | * @param int $perPage |
||
112 | */ |
||
113 | public function setPerPage($perPage) |
||
117 | |||
118 | /** |
||
119 | * returns the total number of items |
||
120 | * @return int |
||
121 | */ |
||
122 | public function getTotalItemCount() |
||
126 | |||
127 | /** |
||
128 | * Method to set the total number of items in the pagination |
||
129 | * |
||
130 | * @param int $totalItemCount |
||
131 | */ |
||
132 | public function setTotalItemCount($totalItemCount) |
||
136 | |||
137 | /** |
||
138 | * Returns the total number of pages needed to display all content which |
||
139 | * is paginatable |
||
140 | * |
||
141 | * @return float |
||
142 | */ |
||
143 | public function getTotalPagesCount() |
||
147 | |||
148 | /** |
||
149 | * This method is used to caluclate the label for a pageoffset, |
||
150 | * in normal cases its the internal offset + 1 |
||
151 | * |
||
152 | * @param int $pageoffset |
||
153 | * @return int |
||
154 | */ |
||
155 | protected function getLabelForPageOffset($pageoffset) |
||
159 | } |
||
160 |