Is it necessary to follow EAV with the models I create for my modules? If not always, when should I and when shouldn't I?


No it is not necessary, especially if you're using your own tables and your own schema for data storage; and that schema is fixed (not end-user-defined).

EAV was used as the basis of Customer, Products (and, once upon a time, Sales) because the schema (business needs) for every install of Magento is potentially different - e.g. some may want to gather a customer's Pet Name during registration, while others would want a product attribute called Flavor.

In short, define your application's scope and the data storage schema - then use Magento's built-in Resource models (ORM) to provide access and CRUD capabilities.

| improve this answer | |
  • Don't forget customer address and categories! :-) – benmarks May 28 '13 at 16:14
  • And Credit Memo, Invoice and Shipment... and (EE) RMA Item... – philwinkle May 28 '13 at 16:18
  • 1
    Credit and invoice were flattened along with other sales entities...? – benmarks May 28 '13 at 16:26
  • LOL I thought we were compiling the full list of once upon a time. Le sigh. – philwinkle May 28 '13 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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