Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
product_attribute_with_invalid_apply_to.php
Go to the documentation of this file.
1 <?php
9  \Magento\Catalog\Setup\CategorySetup::class
10 );
11 
14  \Magento\Catalog\Model\ResourceModel\Eav\Attribute::class
15 );
16 $attribute->setData(
17  [
18  'attribute_code' => 'attribute_with_invalid_applyto',
19  'entity_type_id' => $installer->getEntityTypeId('catalog_product'),
20  'apply_to' => 'invalid-type',
21  ]
22 );
23 $attribute->save();
24 
25 /* Assign attribute to attribute set */
26 $installer->addAttributeToGroup('catalog_product', 'Default', 'General', $attribute->getId());
27 
30 $eavConfig->clear();