1 | <?php |
||
20 | class Standard |
||
21 | extends \Aimeos\Controller\Frontend\Base |
||
22 | implements Iface, \Aimeos\Controller\Frontend\Common\Iface |
||
23 | { |
||
24 | /** |
||
25 | * Adds and returns a new customer item object |
||
26 | * |
||
27 | * @param array $values Values added to the newly created customer item like "customer.birthday" |
||
28 | * @return \Aimeos\MShop\Customer\Item\Iface Customer item |
||
29 | * @since 2017.04 |
||
30 | */ |
||
31 | public function addItem( array $values ) |
||
42 | |||
43 | |||
44 | /** |
||
45 | * Creates a new customer item object pre-filled with the given values but not yet stored |
||
46 | * |
||
47 | * @return \Aimeos\MShop\Customer\Item\Iface Customer item |
||
48 | */ |
||
49 | public function createItem( array $values = [] ) |
||
60 | |||
61 | |||
62 | /** |
||
63 | * Deletes a customer item that belongs to the current authenticated user |
||
64 | * |
||
65 | * @param string $id Unique customer ID |
||
66 | * @since 2017.04 |
||
67 | */ |
||
68 | public function deleteItem( $id ) |
||
75 | |||
76 | |||
77 | /** |
||
78 | * Updates the customer item identified by its ID |
||
79 | * |
||
80 | * @param string $id Unique customer ID |
||
81 | * @param array $values Values added to the customer item like "customer.birthday" or "customer.city" |
||
82 | * @return \Aimeos\MShop\Customer\Item\Iface Customer item |
||
83 | * @since 2017.04 |
||
84 | */ |
||
85 | public function editItem( $id, array $values ) |
||
98 | |||
99 | |||
100 | /** |
||
101 | * Returns the customer item for the given customer ID |
||
102 | * |
||
103 | * @param string|null $id Unique customer ID or null for current customer item |
||
104 | * @param string[] $domains Domain names of items that are associated with the customers and that should be fetched too |
||
105 | * @return \Aimeos\MShop\Customer\Item\Iface Customer item including the referenced domains items |
||
106 | * @since 2017.04 |
||
107 | */ |
||
108 | public function getItem( $id = null, array $domains = [] ) |
||
120 | |||
121 | |||
122 | /** |
||
123 | * Returns the customer item for the given customer code (usually e-mail address) |
||
124 | * |
||
125 | * This method doesn't check if the customer item belongs to the logged in user! |
||
126 | * |
||
127 | * @param string $code Unique customer code |
||
128 | * @param string[] $domains Domain names of items that are associated with the customers and that should be fetched too |
||
129 | * @return \Aimeos\MShop\Customer\Item\Iface Customer item including the referenced domains items |
||
130 | * @since 2017.04 |
||
131 | */ |
||
132 | public function findItem( $code, array $domains = [] ) |
||
136 | |||
137 | |||
138 | /** |
||
139 | * Stores a modified customer item |
||
140 | * |
||
141 | * @param \Aimeos\MShop\Customer\Item\Iface Customer item |
||
142 | */ |
||
143 | public function saveItem( \Aimeos\MShop\Customer\Item\Iface $item ) |
||
147 | |||
148 | |||
149 | /** |
||
150 | * Creates and returns a new item object |
||
151 | * |
||
152 | * @param array $values Values added to the newly created customer item like "customer.birthday" |
||
153 | * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item |
||
154 | * @since 2017.04 |
||
155 | */ |
||
156 | public function addAddressItem( array $values ) |
||
170 | |||
171 | |||
172 | /** |
||
173 | * Creates a new customer address item object pre-filled with the given values but not yet stored |
||
174 | * |
||
175 | * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item |
||
176 | */ |
||
177 | public function createAddressItem( array $values = [] ) |
||
190 | |||
191 | |||
192 | /** |
||
193 | * Deletes a customer item that belongs to the current authenticated user |
||
194 | * |
||
195 | * @param string $id Unique customer address ID |
||
196 | * @since 2017.04 |
||
197 | */ |
||
198 | public function deleteAddressItem( $id ) |
||
206 | |||
207 | |||
208 | /** |
||
209 | * Saves a modified customer item object |
||
210 | * |
||
211 | * @param string $id Unique customer address ID |
||
212 | * @param array $values Values added to the customer item like "customer.address.city" |
||
213 | * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item |
||
214 | * @since 2017.04 |
||
215 | */ |
||
216 | public function editAddressItem( $id, array $values ) |
||
230 | |||
231 | |||
232 | /** |
||
233 | * Returns the customer item for the given customer ID |
||
234 | * |
||
235 | * @param string $id Unique customer address ID |
||
236 | * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item |
||
237 | * @since 2017.04 |
||
238 | */ |
||
239 | public function getAddressItem( $id ) |
||
248 | |||
249 | |||
250 | /** |
||
251 | * Stores a modified customer address item |
||
252 | * |
||
253 | * @param \Aimeos\MShop\Customer\Item\Address\Iface Customer address item |
||
254 | */ |
||
255 | public function saveAddressItem( \Aimeos\MShop\Customer\Item\Address\Iface $item ) |
||
259 | |||
260 | |||
261 | /** |
||
262 | * Creates and returns a new list item object |
||
263 | * |
||
264 | * @param array $values Values added to the newly created customer item like "customer.lists.refid" |
||
265 | * @return \Aimeos\MShop\Common\Item\Lists\Iface Customer lists item |
||
266 | * @since 2017.06 |
||
267 | */ |
||
268 | public function addListsItem( array $values ) |
||
297 | |||
298 | |||
299 | /** |
||
300 | * Returns a new customer lists filter criteria object |
||
301 | * |
||
302 | * @return \Aimeos\MW\Criteria\Iface New filter object |
||
303 | * @since 2017.06 |
||
304 | */ |
||
305 | public function createListsFilter() |
||
315 | |||
316 | |||
317 | /** |
||
318 | * Deletes a customer item that belongs to the current authenticated user |
||
319 | * |
||
320 | * @param string $id Unique customer address ID |
||
321 | * @since 2017.06 |
||
322 | */ |
||
323 | public function deleteListsItem( $id ) |
||
331 | |||
332 | |||
333 | /** |
||
334 | * Saves a modified customer lists item object |
||
335 | * |
||
336 | * @param string $id Unique customer lists ID |
||
337 | * @param array $values Values added to the customer lists item like "customer.lists.refid" |
||
338 | * @return \Aimeos\MShop\Common\Item\Lists\Iface Customer lists item |
||
339 | * @since 2017.06 |
||
340 | */ |
||
341 | public function editListsItem( $id, array $values ) |
||
355 | |||
356 | |||
357 | /** |
||
358 | * Returns the customer item for the given customer ID |
||
359 | * |
||
360 | * @param string $id Unique customer address ID |
||
361 | * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item |
||
362 | * @since 2017.06 |
||
363 | */ |
||
364 | public function getListsItem( $id ) |
||
373 | |||
374 | |||
375 | /** |
||
376 | * Returns the customer lists items filtered by the given criteria |
||
377 | * |
||
378 | * @param \Aimeos\MW\Criteria\Iface $filter Criteria object which contains the filter conditions |
||
379 | * @param integer &$total Parameter where the total number of found attributes will be stored in |
||
380 | * @return \Aimeos\MShop\Common\Item\Lists\Iface[] Customer list items |
||
381 | * @since 2017.06 |
||
382 | */ |
||
383 | public function searchListsItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null ) |
||
389 | |||
390 | |||
391 | /** |
||
392 | * Checks if the current user is allowed to retrieve the customer data for the given ID |
||
393 | * |
||
394 | * @param string $id Unique customer ID |
||
395 | * @throws \Aimeos\Controller\Frontend\Customer\Exception If access isn't allowed |
||
396 | */ |
||
397 | protected function checkUser( $id ) |
||
405 | } |
||
406 |