Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
customer_with_website.php
Go to the documentation of this file.
1 <?php
9 
11 $store = $objectManager->get(\Magento\Store\Model\StoreManager::class);
12 
15  \Magento\Customer\Model\Customer::class,
16  [
17  'data' => [
18  'website_id' => $store->getDefaultStoreView()->getWebsiteId(),
19  'email' => '[email protected]',
20  'store_id' => $store->getDefaultStoreView()->getId(),
21  'is_active' => true,
22  'firstname' => 'John',
23  'lastname' => 'Doe',
24  ]
25  ]
26 );
27 $customer->save();