How to get the default attribute set for an EAV entity type?

APIs

1. \Magento\Eav\Setup\Eav\Setup::getDefaultAttributeSetId()

2. \Magento\Eav\Model\Entity\Type::getDefaultAttributeSetId()

Particular cases: products and categories

Usage


https://github.com/magento/magento2/blob/e0ed4bad/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formgroup.php#L82-L91


https://github.com/magento/magento2/blob/e0ed4bad/app/code/Magento/Catalog/Model/Category/AttributeRepository.php#L73-L75



https://github.com/magento/magento2/blob/e0ed4bad/app/code/Magento/Eav/Model/Entity/AbstractEntity.php#L572-L572



https://github.com/magento/magento2/blob/e0ed4bad/app/code/Magento/Eav/Setup/EavSetup.php#L682-L701


https://github.com/magento/magento2/blob/e0ed4bad/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php#L123-L123

See also: