1 | <?php |
||
20 | class Standard |
||
21 | extends \Aimeos\Controller\Frontend\Base |
||
2 ignored issues
–
show
|
|||
22 | implements Iface, \Aimeos\Controller\Frontend\Common\Iface |
||
1 ignored issue
–
show
|
|||
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 ) |
||
41 | |||
42 | |||
43 | /** |
||
44 | * Creates a new customer item object pre-filled with the given values but not yet stored |
||
45 | * |
||
46 | * @return \Aimeos\MShop\Customer\Item\Iface Customer item |
||
47 | */ |
||
48 | public function createItem( array $values = [] ) |
||
58 | |||
59 | |||
60 | /** |
||
61 | * Deletes a customer item that belongs to the current authenticated user |
||
62 | * |
||
63 | * @param string $id Unique customer ID |
||
64 | * @since 2017.04 |
||
65 | */ |
||
66 | public function deleteItem( $id ) |
||
73 | |||
74 | |||
75 | /** |
||
76 | * Updates the customer item identified by its ID |
||
77 | * |
||
78 | * @param string $id Unique customer ID |
||
79 | * @param array $values Values added to the customer item like "customer.birthday" or "customer.city" |
||
80 | * @return \Aimeos\MShop\Customer\Item\Iface Customer item |
||
81 | * @since 2017.04 |
||
82 | */ |
||
83 | public function editItem( $id, array $values ) |
||
95 | |||
96 | |||
97 | /** |
||
98 | * Returns the customer item for the given customer ID |
||
99 | * |
||
100 | * @param string|null $id Unique customer ID or null for current customer item |
||
101 | * @param string[] $domains Domain names of items that are associated with the customers and that should be fetched too |
||
102 | * @return \Aimeos\MShop\Customer\Item\Iface Customer item including the referenced domains items |
||
103 | * @since 2017.04 |
||
104 | */ |
||
105 | public function getItem( $id = null, array $domains = [] ) |
||
117 | |||
118 | |||
119 | /** |
||
120 | * Returns the customer item for the given customer code (usually e-mail address) |
||
121 | * |
||
122 | * This method doesn't check if the customer item belongs to the logged in user! |
||
123 | * |
||
124 | * @param string $code Unique customer code |
||
125 | * @param string[] $domains Domain names of items that are associated with the customers and that should be fetched too |
||
126 | * @return \Aimeos\MShop\Customer\Item\Iface Customer item including the referenced domains items |
||
127 | * @since 2017.04 |
||
128 | */ |
||
129 | public function findItem( $code, array $domains = [] ) |
||
133 | |||
134 | |||
135 | /** |
||
136 | * Stores a modified customer item |
||
137 | * |
||
138 | * @param \Aimeos\MShop\Customer\Item\Iface Customer item |
||
139 | */ |
||
140 | public function saveItem( \Aimeos\MShop\Customer\Item\Iface $item ) |
||
144 | |||
145 | |||
146 | /** |
||
147 | * Creates and returns a new item object |
||
148 | * |
||
149 | * @param array $values Values added to the newly created customer item like "customer.birthday" |
||
150 | * @return \Aimeos\MShop\Customer\Item\Iface Customer address item |
||
151 | * @since 2017.04 |
||
152 | */ |
||
153 | public function addAddressItem( array $values ) |
||
165 | |||
166 | |||
167 | /** |
||
168 | * Creates a new customer address item object pre-filled with the given values but not yet stored |
||
169 | * |
||
170 | * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item |
||
171 | */ |
||
172 | public function createAddressItem( array $values = [] ) |
||
183 | |||
184 | |||
185 | /** |
||
186 | * Deletes a customer item that belongs to the current authenticated user |
||
187 | * |
||
188 | * @param string $id Unique customer address ID |
||
189 | * @since 2017.04 |
||
190 | */ |
||
191 | public function deleteAddressItem( $id ) |
||
199 | |||
200 | |||
201 | /** |
||
202 | * Saves a modified customer item object |
||
203 | * |
||
204 | * @param string $id Unique customer address ID |
||
205 | * @param array $values Values added to the customer item like "customer.address.city" |
||
206 | * @return \Aimeos\MShop\Customer\Item\Iface Customer address item |
||
207 | * @since 2017.04 |
||
208 | */ |
||
209 | public function editAddressItem( $id, array $values ) |
||
221 | |||
222 | |||
223 | /** |
||
224 | * Returns the customer item for the given customer ID |
||
225 | * |
||
226 | * @param string $id Unique customer address ID |
||
227 | * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item |
||
228 | * @since 2017.04 |
||
229 | */ |
||
230 | public function getAddressItem( $id ) |
||
239 | |||
240 | |||
241 | /** |
||
242 | * Stores a modified customer address item |
||
243 | * |
||
244 | * @param \Aimeos\MShop\Customer\Item\Address\Iface Customer address item |
||
245 | */ |
||
246 | public function saveAddressItem( \Aimeos\MShop\Customer\Item\Address\Iface $item ) |
||
250 | |||
251 | |||
252 | /** |
||
253 | * Checks if the current user is allowed to retrieve the customer data for the given ID |
||
254 | * |
||
255 | * @param string $id Unique customer ID |
||
256 | * @throws \Aimeos\Controller\Frontend\Customer\Exception If access isn't allowed |
||
257 | */ |
||
258 | protected function checkUser( $id ) |
||
266 | } |
||
267 |