@@ -41,8 +41,6 @@ class Customer extends AbstractCustomer
41
41
42
42
public const COLUMN_PASSWORD = 'password ' ;
43
43
44
- public const COLUMN_DISABLE_AUTO_GROUP_CHANGE = 'disable_auto_group_change ' ;
45
-
46
44
/**#@-*/
47
45
48
46
/**#@+
@@ -164,7 +162,7 @@ class Customer extends AbstractCustomer
164
162
'failures_num ' ,
165
163
'first_failure ' ,
166
164
'lock_expires ' ,
167
- self :: COLUMN_DISABLE_AUTO_GROUP_CHANGE ,
165
+ CustomerInterface:: DISABLE_AUTO_GROUP_CHANGE ,
168
166
];
169
167
170
168
/**
@@ -409,7 +407,6 @@ protected function _prepareDataForUpdate(array $rowData)
409
407
$ entitiesToUpdate = [];
410
408
$ attributesToSave = [];
411
409
412
- // entity table data
413
410
$ now = new \DateTime ();
414
411
if (empty ($ rowData ['created_at ' ])) {
415
412
$ createdAt = $ now ;
@@ -426,13 +423,10 @@ protected function _prepareDataForUpdate(array $rowData)
426
423
$ entityId = $ this ->_getNextEntityId ();
427
424
$ this ->_newCustomers [$ emailInLowercase ][$ rowData [self ::COLUMN_WEBSITE ]] = $ entityId ;
428
425
}
429
-
430
- // password change/set
431
426
if (isset ($ rowData ['password ' ]) && strlen ($ rowData ['password ' ])) {
432
427
$ rowData ['password_hash ' ] = $ this ->_customerModel ->hashPassword ($ rowData ['password ' ]);
433
428
}
434
429
$ entityRow = ['entity_id ' => $ entityId ];
435
- // attribute values
436
430
foreach (array_intersect_key ($ rowData , $ this ->_attributes ) as $ attributeCode => $ value ) {
437
431
$ attributeParameters = $ this ->_attributes [$ attributeCode ];
438
432
if (in_array ($ attributeParameters ['type ' ], ['select ' , 'boolean ' ])) {
@@ -484,19 +478,18 @@ protected function _prepareDataForUpdate(array $rowData)
484
478
$ entityRow ['is_active ' ] = 1 ;
485
479
$ entitiesToCreate [] = $ entityRow ;
486
480
} else {
487
- // edit
481
+ $ COLUMN_DISABLE_AUTO_GROUP_CHANGE =CustomerInterface:: DISABLE_AUTO_GROUP_CHANGE ;
488
482
$ entityRow ['updated_at ' ] = $ now ->format (\Magento \Framework \Stdlib \DateTime::DATETIME_PHP_FORMAT );
489
483
if (!empty ($ rowData [self ::COLUMN_STORE ])) {
490
484
$ entityRow ['store_id ' ] = $ this ->_storeCodeToId [$ rowData [self ::COLUMN_STORE ]];
491
485
} else {
492
486
$ entityRow ['store_id ' ] = $ this ->getCustomerStoreId ($ emailInLowercase , $ rowData [self ::COLUMN_WEBSITE ]);
493
487
}
494
- if (!empty ($ rowData [self :: COLUMN_DISABLE_AUTO_GROUP_CHANGE ])) {
495
- $ entityRow [self :: COLUMN_DISABLE_AUTO_GROUP_CHANGE ] = $ rowData [self :: COLUMN_DISABLE_AUTO_GROUP_CHANGE ];
488
+ if (!empty ($ rowData [$ COLUMN_DISABLE_AUTO_GROUP_CHANGE ])) {
489
+ $ entityRow [$ COLUMN_DISABLE_AUTO_GROUP_CHANGE ] = $ rowData [$ COLUMN_DISABLE_AUTO_GROUP_CHANGE ];
496
490
}
497
491
$ entitiesToUpdate [] = $ entityRow ;
498
492
}
499
-
500
493
return [
501
494
self ::ENTITIES_TO_CREATE_KEY => $ entitiesToCreate ,
502
495
self ::ENTITIES_TO_UPDATE_KEY => $ entitiesToUpdate ,
0 commit comments