1 | <?php |
||
11 | class ShoppingCart |
||
12 | { |
||
13 | public $items = null; |
||
14 | public $totalQty; |
||
15 | public $totalPrice; |
||
16 | |||
17 | protected $events; |
||
18 | |||
19 | /** |
||
20 | * Create a new Skeleton Instance |
||
21 | */ |
||
22 | public function __construct(Dispatcher $events) |
||
34 | |||
35 | /** |
||
36 | * get the cart from the Session |
||
37 | * |
||
38 | * @return get the session cart array and the cart object or null |
||
39 | */ |
||
40 | public function getContent() |
||
48 | |||
49 | /** |
||
50 | * update the cart in the Session |
||
51 | * |
||
52 | * @return update the session cart array and the cart object |
||
53 | */ |
||
54 | public function update() |
||
63 | |||
64 | /** |
||
65 | * empty the cart in the Session |
||
66 | * |
||
67 | * @return empty the session cart array |
||
68 | */ |
||
69 | public function destroy() |
||
77 | |||
78 | /** |
||
79 | * Add 1 item to the Cart |
||
80 | * |
||
81 | * @param object $item item to add |
||
82 | * |
||
83 | * @return update the session cart array and the cart object |
||
84 | */ |
||
85 | public function add($item, $qty = null, array $options = null) |
||
124 | |||
125 | /** |
||
126 | * Reduce 1 item from the Cart |
||
127 | * |
||
128 | * @param object $item item to reduce by 1 |
||
129 | * |
||
130 | * @return update the session cart array and the cart object |
||
131 | */ |
||
132 | public function reduceOneItem($uniqueIndex) |
||
151 | |||
152 | /** |
||
153 | * Remove item from the Cart |
||
154 | * |
||
155 | * @param object $item item to remove |
||
156 | * |
||
157 | * @return update the session cart array and the cart object |
||
158 | */ |
||
159 | public function remove($uniqueIndex) |
||
174 | |||
175 | /** |
||
176 | * get the cart items count |
||
177 | * |
||
178 | * @return the cart total quantity |
||
179 | */ |
||
180 | public function count() |
||
185 | |||
186 | /** |
||
187 | * get the cart items total price |
||
188 | * |
||
189 | * @return the cart total price |
||
190 | */ |
||
191 | public function total() |
||
196 | |||
197 | /** |
||
198 | * create unique index |
||
199 | * |
||
200 | * @param item |
||
201 | * |
||
202 | * @param options array |
||
203 | * |
||
204 | * @return uniqueIndex for the shopping cart |
||
205 | */ |
||
206 | public function createUniqueIndex($id, $options) |
||
211 | |||
212 | /** |
||
213 | * update item in the Cart |
||
214 | * |
||
215 | * @param unique item index to modify |
||
216 | * |
||
217 | * @param amount to edit |
||
218 | * |
||
219 | * @return update the session cart array and the cart object |
||
220 | */ |
||
221 | public function modify($uniqueIndex, $qty) |
||
239 | |||
240 | /** |
||
241 | * get item price |
||
242 | * |
||
243 | * @param unique index |
||
244 | * |
||
245 | * @return the item price |
||
246 | */ |
||
247 | public function getItemPrice($uniqueIndex) |
||
257 | |||
258 | /** |
||
259 | * update the item depends on the qty |
||
260 | * |
||
261 | * @param unique index |
||
262 | * |
||
263 | * @param integer $qty |
||
264 | * |
||
265 | * @return void |
||
266 | */ |
||
267 | public function updateItem($uniqueIndex, $qty) |
||
289 | |||
290 | /** |
||
291 | * validate quantity integer and not negative |
||
292 | * |
||
293 | * @param $qty |
||
294 | * |
||
295 | * @return void |
||
296 | */ |
||
297 | public function validateQty($qty) |
||
303 | |||
304 | /** |
||
305 | * check if the cart contain certain offset or not |
||
306 | * |
||
307 | * @param $uniqueIndex |
||
308 | * |
||
309 | * @return void |
||
310 | */ |
||
311 | public function validateIndex($uniqueIndex) |
||
322 | |||
323 | /** |
||
324 | * check if item qty is <= 0 and remove item if true |
||
325 | * |
||
326 | * @param $uniqueIndex |
||
327 | * |
||
328 | * @return void |
||
329 | */ |
||
330 | public function itemQtyStatusCheck($uniqueIndex) |
||
337 | } |
||
338 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.