@@ -21,36 +21,36 @@ class CustomerComposite extends \Magento\ImportExport\Model\Import\AbstractEntit
21
21
* Names that begins with underscore is not an attribute. This name convention is for
22
22
* to avoid interference with same attribute name.
23
23
*/
24
- const COLUMN_ADDRESS_PREFIX = '_address_ ' ;
24
+ public const COLUMN_ADDRESS_PREFIX = '_address_ ' ;
25
25
26
- const COLUMN_DEFAULT_BILLING = '_address_default_billing_ ' ;
26
+ public const COLUMN_DEFAULT_BILLING = '_address_default_billing_ ' ;
27
27
28
- const COLUMN_DEFAULT_SHIPPING = '_address_default_shipping_ ' ;
28
+ public const COLUMN_DEFAULT_SHIPPING = '_address_default_shipping_ ' ;
29
29
30
30
/**#@-*/
31
31
32
32
/**#@+
33
33
* Data row scopes
34
34
*/
35
- const SCOPE_DEFAULT = 1 ;
35
+ public const SCOPE_DEFAULT = 1 ;
36
36
37
- const SCOPE_ADDRESS = -1 ;
37
+ public const SCOPE_ADDRESS = -1 ;
38
38
39
39
/**#@-*/
40
40
41
41
/**#@+
42
42
* Component entity names
43
43
*/
44
- const COMPONENT_ENTITY_CUSTOMER = 'customer ' ;
44
+ public const COMPONENT_ENTITY_CUSTOMER = 'customer ' ;
45
45
46
- const COMPONENT_ENTITY_ADDRESS = 'address ' ;
46
+ public const COMPONENT_ENTITY_ADDRESS = 'address ' ;
47
47
48
48
/**#@-*/
49
49
50
50
/**
51
51
* Error code for orphan rows
52
52
*/
53
- const ERROR_ROW_IS_ORPHAN = 'rowIsOrphan ' ;
53
+ public const ERROR_ROW_IS_ORPHAN = 'rowIsOrphan ' ;
54
54
55
55
/**
56
56
* @var \Magento\CustomerImportExport\Model\Import\Customer
@@ -85,14 +85,14 @@ class CustomerComposite extends \Magento\ImportExport\Model\Import\AbstractEntit
85
85
];
86
86
87
87
/**
88
- * Customer attributes
88
+ * Customer attribute
89
89
*
90
90
* @var string[]
91
91
*/
92
92
protected $ _customerAttributes = [];
93
93
94
94
/**
95
- * Address attributes
95
+ * Address attribute
96
96
*
97
97
* @var string[]
98
98
*/
@@ -134,9 +134,9 @@ class CustomerComposite extends \Magento\ImportExport\Model\Import\AbstractEntit
134
134
protected $ needColumnCheck = true ;
135
135
136
136
/**
137
- * Valid column names
137
+ * Valid column name
138
138
*
139
- * @array
139
+ * @var string[]
140
140
*/
141
141
protected $ validColumnNames = [
142
142
Customer::COLUMN_DEFAULT_BILLING ,
@@ -145,7 +145,7 @@ class CustomerComposite extends \Magento\ImportExport\Model\Import\AbstractEntit
145
145
];
146
146
147
147
/**
148
- * {@inheritdoc}
148
+ * @var string
149
149
*/
150
150
protected $ masterAttributeCode = 'email ' ;
151
151
@@ -278,12 +278,19 @@ protected function _initAddressAttributes()
278
278
*/
279
279
protected function _importData ()
280
280
{
281
+ if ($ this ->getIds ()) {
282
+ $ this ->_customerEntity ->setIds ($ this ->getIds ());
283
+ }
281
284
$ result = $ this ->_customerEntity ->importData ();
282
285
$ this ->countItemsCreated += $ this ->_customerEntity ->getCreatedItemsCount ();
283
286
$ this ->countItemsUpdated += $ this ->_customerEntity ->getUpdatedItemsCount ();
284
287
$ this ->countItemsDeleted += $ this ->_customerEntity ->getDeletedItemsCount ();
285
288
if ($ this ->getBehavior () != \Magento \ImportExport \Model \Import::BEHAVIOR_DELETE ) {
286
- $ result = $ result && $ this ->_addressEntity ->setCustomerAttributes ($ this ->_customerAttributes )->importData ();
289
+ $ addressEntityObject = $ this ->_addressEntity ->setCustomerAttributes ($ this ->_customerAttributes );
290
+ if ($ this ->getIds () && $ addressEntityObject !== null ) {
291
+ $ addressEntityObject ->setIds ($ this ->getIds ());
292
+ }
293
+ $ result = $ result && $ addressEntityObject ->importData ();
287
294
}
288
295
if ($ result ) {
289
296
$ this ->indexerProcessor ->markIndexerAsInvalid ();
0 commit comments