Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
import_data.php
Go to the documentation of this file.
1 <?php
8  0 => [
9  'entity' => 'customer',
10  'behavior' => 'v2_update',
11  'data' => [
12  0 => [
13  'email' => '[email protected]',
14  '_website' => 'base',
15  '_store' => 'admin',
16  'confirmation' => null,
17  'created_at' => '05-06-12 15:53',
18  'created_in' => 'Admin',
19  'default_billing' => '1',
20  'default_shipping' => '1',
21  'disable_auto_group_change' => '0',
22  'dob' => '13-06-1984',
23  'firstname' => 'Anthony',
24  'gender' => 'Male',
25  'group_id' => '1',
26  'lastname' => 'Nealy',
27  'middlename' => 'A.',
28  'password_hash' => '6a9c9bfb2ba88a6ad2a64e7402df44a763e0c48cd21d7af9e7e796cd4677ee28:RF',
29  'prefix' => null,
30  'reward_update_notification' => '1',
31  'reward_warning_notification' => '1',
32  'rp_token' => null,
33  'rp_token_created_at' => null,
34  'store_id' => '0',
35  'suffix' => null,
36  'taxvat' => null,
37  'website_id' => '1',
38  'password' => null,
39  ],
40  1 => [
41  'email' => '[email protected]',
42  '_website' => 'admin',
43  '_store' => 'admin',
44  'confirmation' => null,
45  'created_at' => '05-06-12 15:59',
46  'created_in' => 'Admin',
47  'default_billing' => '3',
48  'default_shipping' => '3',
49  'disable_auto_group_change' => '0',
50  'dob' => '13-06-1984',
51  'firstname' => 'Lori',
52  'gender' => 'Female',
53  'group_id' => '1',
54  'lastname' => 'Banks',
55  'middlename' => 'R.',
56  'password_hash' => '7ad6dbdc83d3e9f598825dc58b84678c7351e4281f6bc2b277a32dcd88b9756b:pz',
57  'prefix' => null,
58  'reward_update_notification' => '1',
59  'reward_warning_notification' => '1',
60  'rp_token' => null,
61  'rp_token_created_at' => null,
62  'store_id' => '0',
63  'suffix' => null,
64  'taxvat' => null,
65  'website_id' => '0',
66  'password' => null,
67  ],
68  ],
69  ],
70  1 => [
71  'entity' => 'customer',
72  'behavior' => 'v2_update',
73  'data' => [
74  0 => [
75  'email' => '[email protected]',
76  '_website' => 'base',
77  '_store' => 'admin',
78  'confirmation' => null,
79  'created_at' => '05-06-12 16:13',
80  'created_in' => 'Admin',
81  'default_billing' => '4',
82  'default_shipping' => '4',
83  'disable_auto_group_change' => '0',
84  'dob' => null,
85  'firstname' => 'Betsy',
86  'gender' => 'Female',
87  'group_id' => '1',
88  'lastname' => 'Parker',
89  'middlename' => 'H.',
90  'password_hash' => '145d12bfff8a6a279eb61e277e3d727c0ba95acc1131237f1594ddbb7687a564:l1',
91  'prefix' => null,
92  'reward_update_notification' => '1',
93  'reward_warning_notification' => '1',
94  'rp_token' => null,
95  'rp_token_created_at' => null,
96  'store_id' => '0',
97  'suffix' => null,
98  'taxvat' => null,
99  'website_id' => '2',
100  'password' => null,
101  ],
102  ],
103  ],
104 ];
105 
107  \Magento\ImportExport\Model\ResourceModel\Import\Data::class
108 );
109 
110 foreach ($bunches as $bunch) {
111  $importDataResource->saveBunch($bunch['entity'], $bunch['behavior'], $bunch['data']);
112 }
113 
116 $objectManager->get(\Magento\Framework\Registry::class)->unregister('_fixture/Magento_ImportExport_Import_Data');
117 $objectManager->get(
118  \Magento\Framework\Registry::class
119 )->register('_fixture/Magento_ImportExport_Import_Data', $bunches);
$objectManager
$importDataResource
$bunches
Definition: import_data.php:7