Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
product_with_dropdown_option_rollback.php
Go to the documentation of this file.
1 <?php
8 
11 
12 $registry->unregister('isSecureArea');
13 $registry->register('isSecureArea', true);
14 
16  ->create(\Magento\Catalog\Api\ProductRepositoryInterface::class);
17 try {
18  $product = $productRepository->get('simple_dropdown_option', false, null, true);
19  $product->delete();
20 } catch (NoSuchEntityException $e) {
21 }
22 $registry->unregister('isSecureArea');
23 $registry->register('isSecureArea', false);