Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
category_with_position_rollback.php
Go to the documentation of this file.
1 <?php
9 $registry = $objectManager->get(\Magento\Framework\Registry::class);
10 
11 $registry->unregister('isSecureArea');
12 $registry->register('isSecureArea', true);
13 
16 $category->load('444');
17 if ($category->getId()) {
18  $category->delete();
19 }
20 
21 $registry->unregister('isSecureArea');
22 $registry->register('isSecureArea', false);