Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
catalog_category_with_apostrophe_rollback.php
Go to the documentation of this file.
1 <?php
9 
11 $registry = $objectManager->get(\Magento\Framework\Registry::class);
12 
13 $registry->unregister('isSecureArea');
14 $registry->register('isSecureArea', true);
15 
17 $collection = $objectManager->create(\Magento\Catalog\Model\ResourceModel\Category\Collection::class);
19  ->addAttributeToFilter('level', 2)
20  ->load()
21  ->delete();
22 
23 $registry->unregister('isSecureArea');
24 $registry->register('isSecureArea', false);