Skip to content

Integrations

Dependencies on Store/Theme, usage by Catalog/Customer/CustomerAddress entities.

Module Dependencies

Magento_Eav has minimal dependencies, allowing it to serve as a core framework component that is consumed by many critical modules for their flexible attribute systems.

Hard Dependencies (require)

Magento_Store
Required for store-scoped attribute values. Each EAV value can be specific to a store view, website, or global scope.
  • StoreManagerInterface - Store context resolution
  • Store ID in value tables for scope differentiation
  • Default value inheritance from parent scopes
Magento_Theme
Provides frontend presentation infrastructure for EAV attribute rendering in layouts and templates.
  • Block rendering for attribute displays
  • Layout XML integration for admin forms
  • Theme inheritance for customizations

Modules Using EAV

The following modules declare EAV as a dependency and use the EAV framework for entity management.

Magento_Catalog
Core User

The largest EAV consumer. Products and categories use EAV for flexible attribute management.

Entity Types
  • catalog_product
  • catalog_category
Features
  • ~200+ product attributes
  • Uses flat tables for frontend
  • Custom backend models for prices/images
Magento_Customer
Core User

Customer and address entities leverage EAV for customizable registration and account fields.

Entity Types
  • customer
  • customer_address
Features
  • ~30+ customer attributes
  • Form field configuration via eav_form
  • Validation rules per form context
Magento_Swatches
Extends

Extends EAV with swatch-based attribute rendering for configurable products (color, size swatches).

Magento_ConfigurableProduct
Uses

Uses EAV attributes as super attributes for product configuration and variation linking.

Magento_CatalogSearch
Uses

Indexes EAV attributes for search functionality and layered navigation.

Magento_ImportExport
Uses

Handles EAV data during product/customer import operations and CSV mapping.

Service Contracts (API)

Magento_Eav exposes service contracts for programmatic attribute management.

Interface Purpose Key Methods
AttributeSetRepositoryInterface Manage attribute sets get(), save(), delete(), getList()
AttributeGroupRepositoryInterface Manage attribute groups within sets get(), save(), delete(), getList()
AttributeRepositoryInterface Generic attribute repository get(), getList()
AttributeSetManagementInterface Create attribute sets from skeleton create()
AttributeOptionManagementInterface Manage attribute options add(), delete(), getItems()

REST API Endpoints

Method Endpoint Description
GET /V1/eav/attribute-sets/list Retrieve list of attribute sets
GET /V1/eav/attribute-sets/:id Retrieve attribute set by ID
POST /V1/eav/attribute-sets Create new attribute set
PUT /V1/eav/attribute-sets/:id Update attribute set
DELETE /V1/eav/attribute-sets/:id Delete attribute set

Extension Points

Magento_Eav provides multiple extension mechanisms for customization.

Custom Backend Models
Extend AbstractBackend for custom validation and data transformation during save/load operations.
Custom Frontend Models
Extend AbstractFrontend for custom display formatting (currency, dates, units).
Custom Source Models
Implement SourceInterface for custom option providers (external APIs, database tables).
Custom Entity Types
Register new EAV entity types via setup scripts for custom data models.

Custom Backend Model Example

// Custom backend model for data transformation class CustomBackend extends AbstractBackend { public function beforeSave($object) { $value = $object->getData($this->getAttribute()->getAttributeCode()); // Transform/validate value before save $object->setData($this->getAttribute()->getAttributeCode(), $processedValue); return $this; } public function validate($object) { // Return true or throw LocalizedException return true; } }

Indexer Integration

EAV data feeds into multiple indexers for frontend performance optimization.

Indexer EAV Data Used Purpose
catalog_product_flat Product EAV attributes Denormalized product data for fast reads
catalog_category_flat Category EAV attributes Denormalized category data
catalogsearch_fulltext Searchable attributes Search engine indexing
catalog_product_attribute Filterable attributes Layered navigation filters

Integration Best Practices

Use Service Contracts

Always interact with EAV through service contracts (repositories) to ensure proper event dispatch and plugin execution.

Cache Attribute Config

Attribute configuration is cached aggressively. Invalidate the EAV cache tag after programmatic attribute changes.

Consider Flat Tables

For high-read entities, implement flat table indexing. EAV is flexible but slow for complex queries.

Batch Operations

For bulk updates, use EntityManager batch operations or direct SQL with proper cache invalidation.