Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
price_row_fixture_rollback.php
Go to the documentation of this file.
1 <?php
7 
10 $registry = $objectManager->get(\Magento\Framework\Registry::class);
11 
12 $registry->unregister('isSecureArea');
13 $registry->register('isSecureArea', true);
14 
16  \Magento\Catalog\Model\ProductRepository::class
17 );
18 try {
19  $product = $repository->get('simple', false, null, true);
20  $product->delete();
21 } catch (NoSuchEntityException $e) {
22  //Entity already deleted
23 }
24 
27 $category->load(9)->delete();
28 
29 $registry->unregister('isSecureArea');
30 $registry->register('isSecureArea', false);