Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
swatch_attribute_rollback.php
Go to the documentation of this file.
1 <?php
8 
9 $registry->unregister('isSecureArea');
10 $registry->register('isSecureArea', true);
11 
14  ->create(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class);
15 
16 $attribute->loadByCode(4, 'color_swatch');
17 
18 if ($attribute->getId()) {
19  $attribute->delete();
20 }
21 
22 $registry->unregister('isSecureArea');
23 $registry->register('isSecureArea', false);