1 | <?php |
||
21 | class Standard |
||
22 | extends \Aimeos\Controller\Frontend\Base |
||
23 | implements Iface, \Aimeos\Controller\Frontend\Common\Iface |
||
24 | { |
||
25 | /** |
||
26 | * Creates and adds a new order for the given order base ID |
||
27 | * |
||
28 | * @param string $baseId Unique ID of the saved basket |
||
29 | * @param string $type Arbitrary order type (max. eight chars) |
||
30 | * @return \Aimeos\MShop\Order\Item\Iface Created order object |
||
31 | */ |
||
32 | public function addItem( $baseId, $type ) |
||
73 | |||
74 | |||
75 | /** |
||
76 | * Returns the filter for searching items |
||
77 | * |
||
78 | * @return \Aimeos\MW\Criteria\Iface Filter object |
||
79 | */ |
||
80 | public function createFilter() |
||
84 | |||
85 | |||
86 | /** |
||
87 | * Returns the order item for the given ID |
||
88 | * |
||
89 | * @param string $id Unique order ID |
||
90 | * @param boolean $default Use default criteria to limit orders |
||
91 | * @return \Aimeos\MShop\Order\Item\Iface Order object |
||
92 | */ |
||
93 | public function getItem( $id, $default = true ) |
||
118 | |||
119 | |||
120 | /** |
||
121 | * Saves the modified order item |
||
122 | * |
||
123 | * @param \Aimeos\MShop\Order\Item\Iface $item Order object |
||
124 | * @return \Aimeos\MShop\Order\Item\Iface Saved order item |
||
125 | */ |
||
126 | public function saveItem( \Aimeos\MShop\Order\Item\Iface $item ) |
||
131 | |||
132 | |||
133 | /** |
||
134 | * Returns the order items based on the given filter that belong to the current user |
||
135 | * |
||
136 | * @param \Aimeos\MW\Criteria\Iface Filter object |
||
137 | * @param integer|null &$total Variable that will contain the total number of available items |
||
138 | * @return \Aimeos\MShop\Order\Item\Iface[] Associative list of IDs as keys and order objects as values |
||
139 | */ |
||
140 | public function searchItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null ) |
||
153 | |||
154 | |||
155 | /** |
||
156 | * Blocks the resources listed in the order. |
||
157 | * |
||
158 | * Every order contains resources like products or redeemed coupon codes |
||
159 | * that must be blocked so they can't be used by another customer in a |
||
160 | * later order. This method reduces the the stock level of products, the |
||
161 | * counts of coupon codes and others. |
||
162 | * |
||
163 | * It's save to call this method multiple times for one order. In this case, |
||
164 | * the actions will be executed only once. All subsequent calls will do |
||
165 | * nothing as long as the resources haven't been unblocked in the meantime. |
||
166 | * |
||
167 | * You can also block and unblock resources several times. Please keep in |
||
168 | * mind that unblocked resources may be reused by other orders in the |
||
169 | * meantime. This can lead to an oversell of products! |
||
170 | * |
||
171 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
||
172 | */ |
||
173 | public function block( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
||
177 | |||
178 | |||
179 | /** |
||
180 | * Frees the resources listed in the order. |
||
181 | * |
||
182 | * If customers created orders but didn't pay for them, the blocked resources |
||
183 | * like products and redeemed coupon codes must be unblocked so they can be |
||
184 | * ordered again or used by other customers. This method increased the stock |
||
185 | * level of products, the counts of coupon codes and others. |
||
186 | * |
||
187 | * It's save to call this method multiple times for one order. In this case, |
||
188 | * the actions will be executed only once. All subsequent calls will do |
||
189 | * nothing as long as the resources haven't been blocked in the meantime. |
||
190 | * |
||
191 | * You can also unblock and block resources several times. Please keep in |
||
192 | * mind that unblocked resources may be reused by other orders in the |
||
193 | * meantime. This can lead to an oversell of products! |
||
194 | * |
||
195 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
||
196 | */ |
||
197 | public function unblock( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
||
201 | |||
202 | |||
203 | /** |
||
204 | * Blocks or frees the resources listed in the order if necessary. |
||
205 | * |
||
206 | * After payment status updates, the resources like products or coupon |
||
207 | * codes listed in the order must be blocked or unblocked. This method |
||
208 | * cares about executing the appropriate action depending on the payment |
||
209 | * status. |
||
210 | * |
||
211 | * It's save to call this method multiple times for one order. In this case, |
||
212 | * the actions will be executed only once. All subsequent calls will do |
||
213 | * nothing as long as the payment status hasn't changed in the meantime. |
||
214 | * |
||
215 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
||
216 | */ |
||
217 | public function update( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
||
221 | |||
222 | |||
223 | /** |
||
224 | * Creates a new order from the given basket. |
||
225 | * |
||
226 | * Saves the given basket to the storage including the addresses, coupons, |
||
227 | * products, services, etc. and creates/stores a new order item for that |
||
228 | * order. |
||
229 | * |
||
230 | * @param \Aimeos\MShop\Order\Item\Base\Iface $basket Basket object to be stored |
||
231 | * @return \Aimeos\MShop\Order\Item\Iface Order item that belongs to the stored basket |
||
232 | * @deprecated 2017.04 Use store() from basket controller instead |
||
233 | */ |
||
234 | public function store( \Aimeos\MShop\Order\Item\Base\Iface $basket ) |
||
252 | } |
||
253 |