Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
product_configurable_with_single_child_rollback.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
11 
12 $objectManager = Bootstrap::getObjectManager();
13 
15 $registry = $objectManager->get(\Magento\Framework\Registry::class);
16 
17 $registry->unregister('isSecureArea');
18 $registry->register('isSecureArea', true);
19 
21 $productRepository = Bootstrap::getObjectManager()
22  ->get(\Magento\Catalog\Api\ProductRepositoryInterface::class);
23 
24 $productSkus = ['configurable_option_single_child', 'configurable_with_single_child'];
26 $searchCriteriaBuilder = Bootstrap::getObjectManager()->get(SearchCriteriaBuilder::class);
27 $searchCriteriaBuilder->addFilter(ProductInterface::SKU, $productSkus, 'in');
29 foreach ($result->getItems() as $product) {
31 }
32 
33 require __DIR__ . '/../../../Magento/Framework/Search/_files/configurable_attribute_rollback.php';
34 
35 $registry->unregister('isSecureArea');
36 $registry->register('isSecureArea', false);
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition: _bootstrap.php:60