Find and reference standard attribute types in Akeneo code

All standard attribute types available in Akeneo are listed in “\Akeneo\Pim\Structure\Component\AttributeTypes” (File: src/Akeneo/Pim/Structure/Component/AttributeTypes.php).

In you own code you could (and should) reference these types instead of using strings.  For example lets say you want to delete attributes by an array of attribute codes but you want to skip identifier attributes from deletion.

Magento change attribute scope in setup script

This code snippet shows how to change attribute scope in a setup script:

And the config.xml: