Log in
Model

AbstractAttribute

Magento\Eav\Model\Entity\Attribute\AbstractAttribute

What it does

AbstractAttribute is the base model class for all EAV (Entity-Attribute-Value) attributes in Magento 2.

Developers extend this class when creating custom product, customer, or catalog attributes, or interact with it when manipulating attribute properties like type, validation rules, frontend display, and source models.

It manages the complete attribute lifecycle including loading, saving, and retrieving associated backend, frontend, and source model instances.

Public Methods

  • loadByCode()
  • getName()
  • setAttributeId()
  • getAttributeId()
  • setAttributeCode()
  • getAttributeCode()
  • setAttributeModel()
  • getAttributeModel()
  • setBackendType()
  • getBackendType()
  • setBackendModel()
  • getBackendModel()
  • setBackendTable()
  • getIsVisibleOnFront()
  • getDefaultValue()
  • setDefaultValue()
  • getAttributeSetId()
  • setAttributeSetId()
  • getEntityTypeId()
  • setEntityTypeId()
  • setEntityType()
  • getAlias()
  • setName()
  • getEntityType()
  • setEntity()
  • getEntity()
  • getEntityIdField()
  • getBackend()
  • getFrontend()
  • getSource()
  • usesSource()
  • isValueEmpty()
  • isAllowedEmptyTextValue()
  • isInSet()
  • isInGroup()
  • getIdByCode()
  • isStatic()
  • getBackendTable()
  • getFlatColumns()
  • _getFlatColumnsDdlDefinition()
  • getFlatIndexes()
  • getFlatUpdateSelect()
  • getIsUnique()
  • setIsUnique()
  • getFrontendClass()
  • setFrontendClass()
  • getFrontendInput()
  • setFrontendInput()
  • getIsRequired()
  • setIsRequired()
  • getOptions()
  • setOptions()
  • getIsUserDefined()
  • setIsUserDefined()
  • getDefaultFrontendLabel()
  • setDefaultFrontendLabel()
  • getFrontendLabels()
  • setFrontendLabels()
  • getNote()
  • setNote()
  • getSourceModel()
  • setSourceModel()
  • getValidationRules()
  • setValidationRules()
  • getExtensionAttributes()
  • setExtensionAttributes()
  • _resetState()