@@ -21,36 +21,36 @@ class CustomerComposite extends \Magento\ImportExport\Model\Import\AbstractEntit
2121 * Names that begins with underscore is not an attribute. This name convention is for
2222 * to avoid interference with same attribute name.
2323 */
24- const COLUMN_ADDRESS_PREFIX = '_address_ ' ;
24+ public const COLUMN_ADDRESS_PREFIX = '_address_ ' ;
2525
26- const COLUMN_DEFAULT_BILLING = '_address_default_billing_ ' ;
26+ public const COLUMN_DEFAULT_BILLING = '_address_default_billing_ ' ;
2727
28- const COLUMN_DEFAULT_SHIPPING = '_address_default_shipping_ ' ;
28+ public const COLUMN_DEFAULT_SHIPPING = '_address_default_shipping_ ' ;
2929
3030 /**#@-*/
3131
3232 /**#@+
3333 * Data row scopes
3434 */
35- const SCOPE_DEFAULT = 1 ;
35+ public const SCOPE_DEFAULT = 1 ;
3636
37- const SCOPE_ADDRESS = -1 ;
37+ public const SCOPE_ADDRESS = -1 ;
3838
3939 /**#@-*/
4040
4141 /**#@+
4242 * Component entity names
4343 */
44- const COMPONENT_ENTITY_CUSTOMER = 'customer ' ;
44+ public const COMPONENT_ENTITY_CUSTOMER = 'customer ' ;
4545
46- const COMPONENT_ENTITY_ADDRESS = 'address ' ;
46+ public const COMPONENT_ENTITY_ADDRESS = 'address ' ;
4747
4848 /**#@-*/
4949
5050 /**
5151 * Error code for orphan rows
5252 */
53- const ERROR_ROW_IS_ORPHAN = 'rowIsOrphan ' ;
53+ public const ERROR_ROW_IS_ORPHAN = 'rowIsOrphan ' ;
5454
5555 /**
5656 * @var \Magento\CustomerImportExport\Model\Import\Customer
@@ -85,14 +85,14 @@ class CustomerComposite extends \Magento\ImportExport\Model\Import\AbstractEntit
8585 ];
8686
8787 /**
88- * Customer attributes
88+ * Customer attribute
8989 *
9090 * @var string[]
9191 */
9292 protected $ _customerAttributes = [];
9393
9494 /**
95- * Address attributes
95+ * Address attribute
9696 *
9797 * @var string[]
9898 */
@@ -134,9 +134,9 @@ class CustomerComposite extends \Magento\ImportExport\Model\Import\AbstractEntit
134134 protected $ needColumnCheck = true ;
135135
136136 /**
137- * Valid column names
137+ * Valid column name
138138 *
139- * @array
139+ * @var string[]
140140 */
141141 protected $ validColumnNames = [
142142 Customer::COLUMN_DEFAULT_BILLING ,
@@ -145,7 +145,7 @@ class CustomerComposite extends \Magento\ImportExport\Model\Import\AbstractEntit
145145 ];
146146
147147 /**
148- * {@inheritdoc}
148+ * @var string
149149 */
150150 protected $ masterAttributeCode = 'email ' ;
151151
@@ -278,12 +278,19 @@ protected function _initAddressAttributes()
278278 */
279279 protected function _importData ()
280280 {
281+ if ($ this ->getIds ()) {
282+ $ this ->_customerEntity ->setIds ($ this ->getIds ());
283+ }
281284 $ result = $ this ->_customerEntity ->importData ();
282285 $ this ->countItemsCreated += $ this ->_customerEntity ->getCreatedItemsCount ();
283286 $ this ->countItemsUpdated += $ this ->_customerEntity ->getUpdatedItemsCount ();
284287 $ this ->countItemsDeleted += $ this ->_customerEntity ->getDeletedItemsCount ();
285288 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 ();
287294 }
288295 if ($ result ) {
289296 $ this ->indexerProcessor ->markIndexerAsInvalid ();
0 commit comments