7

Entities in Magento 2 are like:

  • Product is an entity?

  • Order/Sale is an entity?

  • Customer/Users/Clients is an entity?

  • etc??

Where can I find a list of all entities? Are they declarated in the DB?

For example in eav_attribute table I can see a column entity_type_id that in a default Magento2 installation goes from 1 to 4, these number represents entities?

PD Taking in mind that eav_entity is empty in a default installation

3 Answers 3

20

The eav_attribute table's column entity_type_id is mapped to the eav_entity_type table, you can see the entities there.

enter image description here

3
  • FYI, order & related entities are not of EAV types.
    – MagePsycho
    May 23, 2016 at 13:59
  • @MagePsycho Thats very true, still they are present in the eav_entity_type table, but not sure why.... May 24, 2016 at 7:03
  • @AtishGoswami just curious, why quote is not part of this table. Jun 17, 2021 at 13:21
5

Well, englishly speaking, every object is an entity right ?

But I reckon you're referring to an entity as the EAV (Entity - Attribute - Value) implementation of Magento.

So to answer your question, I reckon you should have a look at the eav_entity_type table which lists the following entities with their entity model, table and attribute model:

  • 1: Customer
  • 2: Customer Address
  • 3: Category
  • 4: Product
  • 5: Order
  • 6: Invoice
  • 7: Credit Memo
  • 8: Shipment
5
  • I just notice that, ty for yor response May 23, 2016 at 8:23
  • 1
    FYI, order & related entities are not of EAV types.
    – MagePsycho
    May 23, 2016 at 13:59
  • @MagePsycho yes I know, how funny is that that there are still referenced in this table. May 23, 2016 at 14:00
  • Yeah it's all about legacy modes :)
    – MagePsycho
    May 23, 2016 at 14:00
  • hi @ Raphael at Digital Pianism, @MagePsycho is there any specifi entity type for product attributes or it is same entity as Catalog_product??I am not certain knowldge on Sep 25, 2017 at 15:41
3

I just notice it (and if it helps to someone)

The table eav_entity_type is where magento2 entities are, for example:

mysql> SELECT entity_type_id, entity_type_code FROM eav_entity_type;
+----------------+------------------+
| entity_type_id | entity_type_code |
+----------------+------------------+
|              3 | catalog_category |
|              4 | catalog_product  |
|              7 | creditmemo       |
|              1 | customer         |
|              2 | customer_address |
|              6 | invoice          |
|              5 | order            |
|              8 | shipment         |
+----------------+------------------+
8 rows in set (0,00 sec)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.