Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
products_for_index_rollback.php
Go to the documentation of this file.
1 <?php
11 
12 Bootstrap::getInstance()->getInstance()->reinitialize();
13 
15 $registry = Bootstrap::getObjectManager()->get(Registry::class);
16 
17 $registry->unregister('isSecureArea');
18 $registry->register('isSecureArea', true);
19 
21 $productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class);
22 
24  'index_enabled',
25  'index_disabled',
26  'index_visible_search',
27  'index_visible_category',
28  'index_visible_both',
29  'index_not_visible'
30 ];
32 $searchCriteriaBuilder = Bootstrap::getObjectManager()->get(SearchCriteriaBuilder::class);
33 $searchCriteriaBuilder->addFilter(ProductInterface::SKU, $productSkus, 'in');
35 foreach ($result->getItems() as $product) {
37 }
38 
39 $registry->unregister('isSecureArea');
40 $registry->register('isSecureArea', false);