Magento – the difference between eav/attribute and eav/entity_attribute

attribute-seteav

Looking at eav_setup file and trying to understand the difference between the eav/attribute and eav/entity_attribute table.

If I have to guess,

eav/attribute is the entity that represents the concept of attribute

eav/entity_attribute is also an attribute which additionally carries the concept of

  • attribute (the actual attribute)
  • entity type that I can describe (entity_type_id)
  • attribute set that I belong (attribute_set_id)
  • attribute group that I belong (attribute_group_id)

I'm not sure about the entity_type_id

When I create the attribute in Magento admin, I create the raw eav/attribute.
When I assign it to attribute set in the admin, I create the eav/entity_attribute. (but where does entity_type_id come from?)

Above statements are pure guesswork, please correct me if I'm wrong.

Best Answer

  1. Entity - Entity actually refers to data item. e.g. catalog_category_entity, catalog_product_entity, customer_entity, customer_address_entity
  2. Attribute - Attribute refers to the different attributes of an Entity. e.g. entity_type_id.
  3. eav_attribute - In this table all attributes for all the entities are stored.
  4. eav_entity_attribute - This table contains all the relations between an attribute, its attribute group and attribute set.
Related Topic