1 | <?php |
||
20 | class Laravel |
||
21 | extends \Aimeos\MShop\Customer\Manager\Standard |
||
|
|||
22 | { |
||
23 | private $searchConfig = array( |
||
24 | // customer.siteid is only for informational purpuse, not for filtering |
||
25 | 'customer.id' => array( |
||
26 | 'label' => 'Customer ID', |
||
27 | 'code' => 'customer.id', |
||
28 | 'internalcode' => 'lvu."id"', |
||
29 | 'type' => 'integer', |
||
30 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT, |
||
31 | 'public' => false, |
||
32 | ), |
||
33 | 'customer.code' => array( |
||
34 | 'label' => 'Customer username', |
||
35 | 'code' => 'customer.code', |
||
36 | 'internalcode' => 'lvu."name"', |
||
37 | 'type' => 'string', |
||
38 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR |
||
39 | ), |
||
40 | 'customer.label' => array( |
||
41 | 'label' => 'Customer label', |
||
42 | 'code' => 'customer.label', |
||
43 | 'internalcode' => 'lvu."label"', |
||
44 | 'type' => 'string', |
||
45 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR |
||
46 | ), |
||
47 | 'customer.salutation' => array( |
||
48 | 'label' => 'Customer salutation', |
||
49 | 'code' => 'customer.salutation', |
||
50 | 'internalcode' => 'lvu."salutation"', |
||
51 | 'type' => 'string', |
||
52 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
53 | ), |
||
54 | 'customer.company'=> array( |
||
55 | 'label' => 'Customer company', |
||
56 | 'code' => 'customer.company', |
||
57 | 'internalcode' => 'lvu."company"', |
||
58 | 'type' => 'string', |
||
59 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
60 | ), |
||
61 | 'customer.vatid'=> array( |
||
62 | 'label' => 'Customer VAT ID', |
||
63 | 'code' => 'customer.vatid', |
||
64 | 'internalcode' => 'lvu."vatid"', |
||
65 | 'type' => 'string', |
||
66 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
67 | ), |
||
68 | 'customer.title' => array( |
||
69 | 'label' => 'Customer title', |
||
70 | 'code' => 'customer.title', |
||
71 | 'internalcode' => 'lvu."title"', |
||
72 | 'type' => 'string', |
||
73 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
74 | ), |
||
75 | 'customer.firstname' => array( |
||
76 | 'label' => 'Customer firstname', |
||
77 | 'code' => 'customer.firstname', |
||
78 | 'internalcode' => 'lvu."firstname"', |
||
79 | 'type' => 'string', |
||
80 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
81 | ), |
||
82 | 'customer.lastname' => array( |
||
83 | 'label' => 'Customer lastname', |
||
84 | 'code' => 'customer.lastname', |
||
85 | 'internalcode' => 'lvu."lastname"', |
||
86 | 'type' => 'string', |
||
87 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
88 | ), |
||
89 | 'customer.address1' => array( |
||
90 | 'label' => 'Customer address part one', |
||
91 | 'code' => 'customer.address1', |
||
92 | 'internalcode' => 'lvu."address1"', |
||
93 | 'type' => 'string', |
||
94 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
95 | ), |
||
96 | 'customer.address2' => array( |
||
97 | 'label' => 'Customer address part two', |
||
98 | 'code' => 'customer.address2', |
||
99 | 'internalcode' => 'lvu."address2"', |
||
100 | 'type' => 'string', |
||
101 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
102 | ), |
||
103 | 'customer.address3' => array( |
||
104 | 'label' => 'Customer address part three', |
||
105 | 'code' => 'customer.address3', |
||
106 | 'internalcode' => 'lvu."address3"', |
||
107 | 'type' => 'string', |
||
108 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
109 | ), |
||
110 | 'customer.postal' => array( |
||
111 | 'label' => 'Customer postal', |
||
112 | 'code' => 'customer.postal', |
||
113 | 'internalcode' => 'lvu."postal"', |
||
114 | 'type' => 'string', |
||
115 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
116 | ), |
||
117 | 'customer.city' => array( |
||
118 | 'label' => 'Customer city', |
||
119 | 'code' => 'customer.city', |
||
120 | 'internalcode' => 'lvu."city"', |
||
121 | 'type' => 'string', |
||
122 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
123 | ), |
||
124 | 'customer.state' => array( |
||
125 | 'label' => 'Customer state', |
||
126 | 'code' => 'customer.state', |
||
127 | 'internalcode' => 'lvu."state"', |
||
128 | 'type' => 'string', |
||
129 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
130 | ), |
||
131 | 'customer.languageid' => array( |
||
132 | 'label' => 'Customer language', |
||
133 | 'code' => 'customer.languageid', |
||
134 | 'internalcode' => 'lvu."langid"', |
||
135 | 'type' => 'string', |
||
136 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
137 | ), |
||
138 | 'customer.countryid' => array( |
||
139 | 'label' => 'Customer country', |
||
140 | 'code' => 'customer.countryid', |
||
141 | 'internalcode' => 'lvu."countryid"', |
||
142 | 'type' => 'string', |
||
143 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
144 | ), |
||
145 | 'customer.telephone' => array( |
||
146 | 'label' => 'Customer telephone', |
||
147 | 'code' => 'customer.telephone', |
||
148 | 'internalcode' => 'lvu."telephone"', |
||
149 | 'type' => 'string', |
||
150 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
151 | ), |
||
152 | 'customer.email' => array( |
||
153 | 'label' => 'Customer email', |
||
154 | 'code' => 'customer.email', |
||
155 | 'internalcode' => 'lvu."email"', |
||
156 | 'type' => 'string', |
||
157 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
158 | ), |
||
159 | 'customer.telefax' => array( |
||
160 | 'label' => 'Customer telefax', |
||
161 | 'code' => 'customer.telefax', |
||
162 | 'internalcode' => 'lvu."telefax"', |
||
163 | 'type' => 'string', |
||
164 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
165 | ), |
||
166 | 'customer.website' => array( |
||
167 | 'label' => 'Customer website', |
||
168 | 'code' => 'customer.website', |
||
169 | 'internalcode' => 'lvu."website"', |
||
170 | 'type' => 'string', |
||
171 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
172 | ), |
||
173 | 'customer.longitude' => array( |
||
174 | 'label' => 'Customer longitude', |
||
175 | 'code' => 'customer.longitude', |
||
176 | 'internalcode' => 'lvu."longitude"', |
||
177 | 'type' => 'string', |
||
178 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
179 | ), |
||
180 | 'customer.latitude' => array( |
||
181 | 'label' => 'Customer latitude', |
||
182 | 'code' => 'customer.latitude', |
||
183 | 'internalcode' => 'lvu."latitude"', |
||
184 | 'type' => 'string', |
||
185 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
186 | ), |
||
187 | 'customer.birthday' => array( |
||
188 | 'label' => 'Customer birthday', |
||
189 | 'code' => 'customer.birthday', |
||
190 | 'internalcode' => 'lvu."birthday"', |
||
191 | 'type' => 'string', |
||
192 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
193 | ), |
||
194 | 'customer.password'=> array( |
||
195 | 'label' => 'Customer password', |
||
196 | 'code' => 'customer.password', |
||
197 | 'internalcode' => 'lvu."password"', |
||
198 | 'type' => 'string', |
||
199 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
200 | ), |
||
201 | 'customer.status'=> array( |
||
202 | 'label' => 'Customer status', |
||
203 | 'code' => 'customer.status', |
||
204 | 'internalcode' => 'lvu."status"', |
||
205 | 'type' => 'integer', |
||
206 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT |
||
207 | ), |
||
208 | 'customer.dateverified'=> array( |
||
209 | 'label' => 'Customer verification date', |
||
210 | 'code' => 'customer.dateverified', |
||
211 | 'internalcode' => 'lvu."vdate"', |
||
212 | 'type' => 'date', |
||
213 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
214 | ), |
||
215 | 'customer.ctime'=> array( |
||
216 | 'label' => 'Customer creation time', |
||
217 | 'code' => 'customer.ctime', |
||
218 | 'internalcode' => 'lvu."created_at"', |
||
219 | 'type' => 'datetime', |
||
220 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
221 | ), |
||
222 | 'customer.mtime'=> array( |
||
223 | 'label' => 'Customer modification time', |
||
224 | 'code' => 'customer.mtime', |
||
225 | 'internalcode' => 'lvu."updated_at"', |
||
226 | 'type' => 'datetime', |
||
227 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
228 | ), |
||
229 | 'customer.editor'=> array( |
||
230 | 'label'=>'Customer editor', |
||
231 | 'code'=>'customer.editor', |
||
232 | 'internalcode' => 'lvu."editor"', |
||
233 | 'type'=> 'string', |
||
234 | 'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_STR, |
||
235 | ), |
||
236 | ); |
||
237 | |||
238 | |||
239 | /** |
||
240 | * Removes old entries from the storage. |
||
241 | * |
||
242 | * @param array $siteids List of IDs for sites whose entries should be deleted |
||
243 | */ |
||
244 | public function cleanup( array $siteids ) |
||
253 | |||
254 | |||
255 | /** |
||
256 | * Removes multiple items specified by ids in the array. |
||
257 | * |
||
258 | * @param array $ids List of IDs |
||
259 | */ |
||
260 | public function deleteItems( array $ids ) |
||
265 | |||
266 | |||
267 | /** |
||
268 | * Returns the list attributes that can be used for searching. |
||
269 | * |
||
270 | * @param boolean $withsub Return also attributes of sub-managers if true |
||
271 | * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface |
||
272 | */ |
||
273 | public function getSearchAttributes( $withsub = true ) |
||
280 | |||
281 | |||
282 | /** |
||
283 | * Saves a customer item object. |
||
284 | * |
||
285 | * @param \Aimeos\MShop\Customer\Item\Iface $item Customer item object |
||
286 | * @param boolean $fetch True if the new ID should be returned in the item |
||
287 | * @return \Aimeos\MShop\Common\Item\Iface $item Updated item including the generated ID |
||
288 | */ |
||
289 | public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true ) |
||
466 | |||
467 | |||
468 | /** |
||
469 | * Returns the item objects matched by the given search criteria. |
||
470 | * |
||
471 | * @param \Aimeos\MW\Criteria\Iface $search Search criteria object |
||
472 | * @param integer &$total Number of items that are available in total |
||
473 | * @return array List of items implementing \Aimeos\MShop\Customer\Item\Iface |
||
474 | * @throws \Aimeos\MShop\Customer\Exception If creating items failed |
||
475 | */ |
||
476 | public function searchItems( \Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null ) |
||
515 | |||
516 | |||
517 | /** |
||
518 | * Returns a new manager for customer extensions |
||
519 | * |
||
520 | * @param string $manager Name of the sub manager type in lower case |
||
521 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
||
522 | * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
||
523 | */ |
||
524 | public function getSubManager( $manager, $name = null ) |
||
528 | } |
||
529 |