Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
create_attribute_service_rollback.php
Go to the documentation of this file.
1 <?php
7 
10 $registry->unregister('isSecureArea');
11 $registry->register('isSecureArea', true);
12 
14 $attribute = Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class);
15 $attribute->loadByCode(4, 'label_attr_code3df4tr3');
16 
17 if ($attribute->getId()) {
18  $attribute->delete();
19 }
20 
22 $attribute = Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class);
23 $attribute->loadByCode(4, 'test_attribute_code_l');
24 
25 if ($attribute->getId()) {
26  $attribute->delete();
27 }