When added attributes to Entities, e.g. Customers or Products, the third argument to EavSetup::addAttribute() is an array of attribute keys. For instance:
$eavSetup->addAttribute( \Magento\Catalog\Model\Product::ENTITY, 'custom_attribute', [ 'label' => 'Custom Attribute', 'type' => 'int', 'backend' => '', 'frontend' => '', 'input' => '', 'class' => '', 'source' => '', 'global' => \Magento\Catalog\Model\Resource\Eav\Attribute::SCOPE_GLOBAL, 'visible' => true, 'required' => false, 'user_defined' => false, 'default' => 0, 'searchable' => false, 'filterable' => false, 'comparable' => false, 'visible_on_front' => false, 'used_in_product_listing' => true, 'unique' => false, 'apply_to' => '', ] );
Where might I find a list of acceptable array keys for Products, Customers, and other Entities? Thank you.
Solved! Go to Solution.
I love it. I got to about the second step before putting down the keyboard and picking up the whiskey - then posted this question. Perhaps some day I'll be so bored as to sit down and write a Module that might go through all the relevant XML files and method definitions and database tables and tarot cards.
Thank you. Back to the whiskey.