1 | <?php |
||
7 | class Carbon_Pagination_Collection { |
||
8 | |||
9 | /** |
||
10 | * @var array |
||
11 | * |
||
12 | * Pagination items. |
||
13 | */ |
||
14 | protected $items = array(); |
||
15 | |||
16 | /** |
||
17 | * @var Carbon_Pagination_HTML |
||
18 | * |
||
19 | * The pagination object. |
||
20 | */ |
||
21 | protected $pagination; |
||
22 | |||
23 | /** |
||
24 | * Constructor. |
||
25 | * Creates and configures a new pagination collection for the provided pagination. |
||
26 | * |
||
27 | * @param Carbon_Pagination_HTML $pagination Pagination object. |
||
28 | * @param bool $autogenerate Whether to automatically generate pagination items. |
||
29 | */ |
||
30 | 5 | public function __construct( Carbon_Pagination_HTML $pagination, $autogenerate = true ) { |
|
39 | |||
40 | /** |
||
41 | * Generate the pagination items and wrappers. |
||
42 | */ |
||
43 | 4 | public function generate() { |
|
50 | |||
51 | /** |
||
52 | * Retrieve the item prototypes for the collection. |
||
53 | * These represent the classes of all items that will be generated and their |
||
54 | * corresponding pagination methods that determine their availability. |
||
55 | */ |
||
56 | 2 | public function get_item_prototypes() { |
|
70 | |||
71 | /** |
||
72 | * Generate the pagination items. |
||
73 | */ |
||
74 | 5 | public function generate_items() { |
|
90 | |||
91 | /** |
||
92 | * Generate the pagination wrappers. |
||
93 | */ |
||
94 | 2 | public function generate_wrappers() { |
|
110 | |||
111 | /** |
||
112 | * Retrieve the pagination object. |
||
113 | * |
||
114 | * @return Carbon_Pagination_HTML $pagination The pagination object. |
||
115 | */ |
||
116 | 1 | public function get_pagination() { |
|
119 | |||
120 | /** |
||
121 | * Modify the pagination object. |
||
122 | * |
||
123 | * @param Carbon_Pagination_HTML $pagination The new pagination object. |
||
124 | */ |
||
125 | 1 | public function set_pagination( Carbon_Pagination_HTML $pagination ) { |
|
128 | |||
129 | /** |
||
130 | * Retrieve the pagination items in the collection. |
||
131 | * |
||
132 | * @return array $items The pagination items, contained in the collection. |
||
133 | */ |
||
134 | 1 | public function get_items() { |
|
137 | |||
138 | /** |
||
139 | * Modify the pagination items in the collection. |
||
140 | * |
||
141 | * @param array $items The new set of pagination items. |
||
142 | */ |
||
143 | 1 | public function set_items( $items = array() ) { |
|
146 | |||
147 | /** |
||
148 | * Add item(s) to the collection. |
||
149 | * If $new_items is not an array, it will be treated as one item. |
||
150 | * If $new_items is an array, it will be treated as a set of items. |
||
151 | * |
||
152 | * @param mixed $new_items The set of pagination items to add. |
||
153 | */ |
||
154 | 4 | public function add_items( $new_items = array() ) { |
|
166 | |||
167 | /** |
||
168 | * Insert item(s) at a specified index in the collection. |
||
169 | * If the $item is an array, it will be treated as a set of items. |
||
170 | * If the $item is not an array, it will be treated as a single item. |
||
171 | * |
||
172 | * @param mixed $item The item(s) to insert. |
||
173 | * @param int $index The index to insert the item at. |
||
174 | */ |
||
175 | 6 | public function insert_item_at( $item, $index ) { |
|
187 | |||
188 | } |