Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
products_with_multiselect_attribute_rollback.php
Go to the documentation of this file.
1 <?php
7 require __DIR__ . '/multiselect_attribute_rollback.php';
8 
10 
15 $registry->unregister('isSecureArea');
16 $registry->register('isSecureArea', true);
17 
20  ->create('Magento\Catalog\Model\Product')
21  ->getCollection();
22 
23 foreach ($productCollection as $product) {
24  $product->delete();
25 }
26 
27 $registry->unregister('isSecureArea');
28 $registry->register('isSecureArea', false);
29 
31  ->get(Magento\CatalogInventory\Model\Indexer\Stock\Processor::INDEXER_ID)
32  ->reindexAll();
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition: _bootstrap.php:60