Question

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

Was it helpful?

Solution

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

OTHER TIPS

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

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)
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top