1
1
<?php
2
2
/**
3
- * Customer resource setup model
4
- *
5
3
* Copyright © Magento, Inc. All rights reserved.
6
4
* See COPYING.txt for license details.
7
5
*/
6
+ declare (strict_types=1 );
7
+
8
8
namespace Magento \Customer \Setup ;
9
9
10
+ use Magento \Customer \Api \AddressMetadataInterface ;
11
+ use Magento \Customer \Api \CustomerMetadataInterface ;
12
+ use Magento \Customer \Model \Attribute ;
13
+ use Magento \Customer \Model \Attribute \Backend \Data \Boolean ;
14
+ use Magento \Customer \Model \Attribute \Data \Postcode ;
15
+ use Magento \Customer \Model \Customer \Attribute \Backend \Billing ;
16
+ use Magento \Customer \Model \Customer \Attribute \Backend \Password ;
17
+ use Magento \Customer \Model \Customer \Attribute \Backend \Shipping ;
18
+ use Magento \Customer \Model \Customer \Attribute \Backend \Store ;
19
+ use Magento \Customer \Model \Customer \Attribute \Backend \Website ;
20
+ use Magento \Customer \Model \Customer \Attribute \Source \Group ;
21
+ use Magento \Customer \Model \ResourceModel \Address ;
22
+ use Magento \Customer \Model \ResourceModel \Address \Attribute \Backend \Region ;
23
+ use Magento \Customer \Model \ResourceModel \Address \Attribute \Collection ;
24
+ use Magento \Customer \Model \ResourceModel \Address \Attribute \Source \Country ;
25
+ use Magento \Customer \Model \ResourceModel \Customer ;
10
26
use Magento \Eav \Model \Config ;
27
+ use Magento \Eav \Model \Entity \Attribute \Backend \Datetime ;
28
+ use Magento \Eav \Model \Entity \Attribute \Backend \DefaultBackend ;
29
+ use Magento \Eav \Model \Entity \Attribute \Source \Table ;
30
+ use Magento \Eav \Model \Entity \Increment \NumericValue ;
11
31
use Magento \Eav \Model \Entity \Setup \Context ;
32
+ use Magento \Eav \Model \ResourceModel \Entity \Attribute \Group \CollectionFactory ;
12
33
use Magento \Eav \Setup \EavSetup ;
13
34
use Magento \Framework \App \CacheInterface ;
14
35
use Magento \Framework \Setup \ModuleDataSetupInterface ;
15
- use Magento \Eav \Model \ResourceModel \Entity \Attribute \Group \CollectionFactory ;
16
36
17
37
/**
38
+ * Customer resource setup model
39
+ *
40
+ * @api
18
41
* @codeCoverageIgnore
19
42
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
20
43
*/
@@ -127,11 +150,11 @@ public function getDefaultEntities()
127
150
{
128
151
$ entities = [
129
152
'customer ' => [
130
- 'entity_type_id ' => \ Magento \ Customer \ Api \ CustomerMetadataInterface::ATTRIBUTE_SET_ID_CUSTOMER ,
131
- 'entity_model ' => \ Magento \ Customer \ Model \ ResourceModel \ Customer::class,
132
- 'attribute_model ' => \ Magento \ Customer \ Model \ Attribute::class,
153
+ 'entity_type_id ' => CustomerMetadataInterface::ATTRIBUTE_SET_ID_CUSTOMER ,
154
+ 'entity_model ' => Customer::class,
155
+ 'attribute_model ' => Attribute::class,
133
156
'table ' => 'customer_entity ' ,
134
- 'increment_model ' => \ Magento \ Eav \ Model \ Entity \ Increment \ NumericValue::class,
157
+ 'increment_model ' => NumericValue::class,
135
158
'additional_attribute_table ' => 'customer_eav_attribute ' ,
136
159
'entity_attribute_collection ' => \Magento \Customer \Model \ResourceModel \Attribute \Collection::class,
137
160
'attributes ' => [
@@ -140,7 +163,7 @@ public function getDefaultEntities()
140
163
'label ' => 'Associate to Website ' ,
141
164
'input ' => 'select ' ,
142
165
'source ' => \Magento \Customer \Model \Customer \Attribute \Source \Website::class,
143
- 'backend ' => \ Magento \ Customer \ Model \ Customer \ Attribute \ Backend \ Website::class,
166
+ 'backend ' => Website::class,
144
167
'sort_order ' => 10 ,
145
168
'position ' => 10 ,
146
169
'adminhtml_only ' => 1 ,
@@ -150,7 +173,7 @@ public function getDefaultEntities()
150
173
'label ' => 'Create In ' ,
151
174
'input ' => 'select ' ,
152
175
'source ' => \Magento \Customer \Model \Customer \Attribute \Source \Store::class,
153
- 'backend ' => \ Magento \ Customer \ Model \ Customer \ Attribute \ Backend \ Store::class,
176
+ 'backend ' => Store::class,
154
177
'sort_order ' => 20 ,
155
178
'visible ' => false ,
156
179
'adminhtml_only ' => 1 ,
@@ -223,7 +246,7 @@ public function getDefaultEntities()
223
246
'type ' => 'static ' ,
224
247
'label ' => 'Group ' ,
225
248
'input ' => 'select ' ,
226
- 'source ' => \ Magento \ Customer \ Model \ Customer \ Attribute \ Source \ Group::class,
249
+ 'source ' => Group::class,
227
250
'sort_order ' => 25 ,
228
251
'position ' => 25 ,
229
252
'adminhtml_only ' => 1 ,
@@ -234,7 +257,7 @@ public function getDefaultEntities()
234
257
'label ' => 'Date of Birth ' ,
235
258
'input ' => 'date ' ,
236
259
'frontend ' => \Magento \Eav \Model \Entity \Attribute \Frontend \Datetime::class,
237
- 'backend ' => \ Magento \ Eav \ Model \ Entity \ Attribute \ Backend \ Datetime::class,
260
+ 'backend ' => Datetime::class,
238
261
'required ' => false ,
239
262
'sort_order ' => 90 ,
240
263
'visible ' => false ,
@@ -247,7 +270,7 @@ public function getDefaultEntities()
247
270
'password_hash ' => [
248
271
'type ' => 'static ' ,
249
272
'input ' => 'hidden ' ,
250
- 'backend ' => \ Magento \ Customer \ Model \ Customer \ Attribute \ Backend \ Password::class,
273
+ 'backend ' => Password::class,
251
274
'required ' => false ,
252
275
'sort_order ' => 81 ,
253
276
'visible ' => false ,
@@ -271,7 +294,7 @@ public function getDefaultEntities()
271
294
'type ' => 'static ' ,
272
295
'label ' => 'Default Billing Address ' ,
273
296
'input ' => 'text ' ,
274
- 'backend ' => \ Magento \ Customer \ Model \ Customer \ Attribute \ Backend \ Billing::class,
297
+ 'backend ' => Billing::class,
275
298
'required ' => false ,
276
299
'sort_order ' => 82 ,
277
300
'visible ' => false ,
@@ -280,7 +303,7 @@ public function getDefaultEntities()
280
303
'type ' => 'static ' ,
281
304
'label ' => 'Default Shipping Address ' ,
282
305
'input ' => 'text ' ,
283
- 'backend ' => \ Magento \ Customer \ Model \ Customer \ Attribute \ Backend \ Shipping::class,
306
+ 'backend ' => Shipping::class,
284
307
'required ' => false ,
285
308
'sort_order ' => 83 ,
286
309
'visible ' => false ,
@@ -318,7 +341,7 @@ public function getDefaultEntities()
318
341
'type ' => 'static ' ,
319
342
'label ' => 'Gender ' ,
320
343
'input ' => 'select ' ,
321
- 'source ' => \ Magento \ Eav \ Model \ Entity \ Attribute \ Source \ Table::class,
344
+ 'source ' => Table::class,
322
345
'required ' => false ,
323
346
'sort_order ' => 110 ,
324
347
'visible ' => false ,
@@ -332,21 +355,20 @@ public function getDefaultEntities()
332
355
'type ' => 'static ' ,
333
356
'label ' => 'Disable Automatic Group Change Based on VAT ID ' ,
334
357
'input ' => 'boolean ' ,
335
- 'backend ' => \ Magento \ Customer \ Model \ Attribute \ Backend \ Data \ Boolean::class,
358
+ 'backend ' => Boolean::class,
336
359
'position ' => 28 ,
337
360
'required ' => false ,
338
361
'adminhtml_only ' => true
339
362
]
340
363
],
341
364
],
342
365
'customer_address ' => [
343
- 'entity_type_id ' => \ Magento \ Customer \ Api \ AddressMetadataInterface::ATTRIBUTE_SET_ID_ADDRESS ,
344
- 'entity_model ' => \ Magento \ Customer \ Model \ ResourceModel \ Address::class,
345
- 'attribute_model ' => \ Magento \ Customer \ Model \ Attribute::class,
366
+ 'entity_type_id ' => AddressMetadataInterface::ATTRIBUTE_SET_ID_ADDRESS ,
367
+ 'entity_model ' => Address::class,
368
+ 'attribute_model ' => Attribute::class,
346
369
'table ' => 'customer_address_entity ' ,
347
370
'additional_attribute_table ' => 'customer_eav_attribute ' ,
348
- 'entity_attribute_collection ' =>
349
- \Magento \Customer \Model \ResourceModel \Address \Attribute \Collection::class,
371
+ 'entity_attribute_collection ' => Collection::class,
350
372
'attributes ' => [
351
373
'prefix ' => [
352
374
'type ' => 'static ' ,
@@ -407,7 +429,7 @@ public function getDefaultEntities()
407
429
'type ' => 'static ' ,
408
430
'label ' => 'Street Address ' ,
409
431
'input ' => 'multiline ' ,
410
- 'backend ' => \ Magento \ Eav \ Model \ Entity \ Attribute \ Backend \ DefaultBackend::class,
432
+ 'backend ' => DefaultBackend::class,
411
433
'sort_order ' => 70 ,
412
434
'multiline_count ' => 2 ,
413
435
'validate_rules ' => '{"max_text_length":255,"min_text_length":1} ' ,
@@ -425,15 +447,15 @@ public function getDefaultEntities()
425
447
'type ' => 'static ' ,
426
448
'label ' => 'Country ' ,
427
449
'input ' => 'select ' ,
428
- 'source ' => \ Magento \ Customer \ Model \ ResourceModel \ Address \ Attribute \ Source \ Country::class,
450
+ 'source ' => Country::class,
429
451
'sort_order ' => 90 ,
430
452
'position ' => 90 ,
431
453
],
432
454
'region ' => [
433
455
'type ' => 'static ' ,
434
456
'label ' => 'State/Province ' ,
435
457
'input ' => 'text ' ,
436
- 'backend ' => \ Magento \ Customer \ Model \ ResourceModel \ Address \ Attribute \ Backend \ Region::class,
458
+ 'backend ' => Region::class,
437
459
'required ' => false ,
438
460
'sort_order ' => 100 ,
439
461
'position ' => 100 ,
@@ -442,7 +464,7 @@ public function getDefaultEntities()
442
464
'type ' => 'static ' ,
443
465
'label ' => 'State/Province ' ,
444
466
'input ' => 'hidden ' ,
445
- 'source ' => \ Magento \ Customer \ Model \ ResourceModel \ Address \Attribute \Source \Region::class,
467
+ 'source ' => Address \Attribute \Source \Region::class,
446
468
'required ' => false ,
447
469
'sort_order ' => 100 ,
448
470
'position ' => 100 ,
@@ -453,7 +475,7 @@ public function getDefaultEntities()
453
475
'input ' => 'text ' ,
454
476
'sort_order ' => 110 ,
455
477
'validate_rules ' => '[] ' ,
456
- 'data ' => \ Magento \ Customer \ Model \ Attribute \ Data \ Postcode::class,
478
+ 'data ' => Postcode::class,
457
479
'position ' => 110 ,
458
480
'required ' => false ,
459
481
],
0 commit comments