Log in
Model

Code

Magento\Eav\Model\Validator\Attribute\Code

What it does

This validator class ensures EAV attribute codes meet Magento's requirements before they are saved.

Developers use it to validate that attribute codes start with a letter, contain only alphanumeric characters and underscores, fall within the allowed length range (1-60 characters), and don't use reserved system prefixes.

It's typically called during attribute creation or modification to prevent invalid attribute codes.

Public Methods

  • isValid()