Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
product_simple_77_rollback.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
10 
11 $registry->unregister('isSecureArea');
12 $registry->register('isSecureArea', true);
13 
18  ->get(\Magento\Catalog\Api\ProductRepositoryInterface::class);
19 try {
20  $product = $productRepository->get('simple_77', false, null, true);
22 } catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
23  //Product already removed
24 }
25 
26 $registry->unregister('isSecureArea');
27 $registry->register('isSecureArea', false);