Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
five_repository_customers_rollback.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
11 use Magento\Eav\Model\Config as EavModelConfig;
12 
13 $objectManager = Bootstrap::getObjectManager();
14 
16 $customerRepository = $objectManager->create(CustomerRepositoryInterface::class);
17 
18 for ($i = 1; $i <= 5; $i++) {
19  try {
21  $customer = $customerRepository->get('customer'.$i.'@example.com');
23  } catch (\Exception $e) {
24  }
25 }
26 
28 $eavConfig = $objectManager->get(EavModelConfig::class);
29 $eavConfig->clear();
$customer
Definition: customers.php:11
$i
Definition: gallery.phtml:31