Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
attribute_user_defined.php
Go to the documentation of this file.
1 <?php
8  \Magento\Catalog\Model\ResourceModel\Eav\Attribute::class
9 );
10 $model->setName('user_attribute')->setId(1)->setEntityTypeId(4)->setIsUserDefined(1);
11 $model->save();