Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
attribute_rollback.php
Go to the documentation of this file.
1 <?php
8 
10 $installer = $objectManager->create(\Magento\Catalog\Setup\CategorySetup::class);
11 
13 $eavRepository = $objectManager->get(\Magento\Eav\Api\AttributeRepositoryInterface::class);
14 
15 try {
16  $attribute = $eavRepository->get($installer->getEntityTypeId('catalog_product'), 'test_attribute');
17  $eavRepository->delete($attribute);
18 } catch (\Exception $ex) {
19  //Nothing to remove
20 }
$eavRepository
$objectManager