Book Image

Magento PHP Developer's Guide

By : Allan MacGregor
Book Image

Magento PHP Developer's Guide

By: Allan MacGregor

Overview of this book

<p>Magento has completely reshaped the face of e-commerce since its launch in 2008. Its revolutionary focus on object oriented and EAV design patterns has allowed it to become the preferred tool for developers and retailers alike.</p> <p>"Magento PHP Developer’s Guide" is a complete reference to Magento, allowing developers to understand its fundamental concepts, and get them developing and testing Magento code.</p> <p>The book starts by building the reader’s knowledge of Magento, providing them with the information, techniques, and tools that they require to start their first Magento development.</p> <p>After building this knowledge, the book will then look at more advanced topics: how to test your code, how to extend the frontend and backend, and deploying and distributing custom modules.</p> <p>"Magento PHP Developer’s Guide" will help you navigate your way around your first Magento developments, helping you to avoid all of the most common headaches new developers face when first getting started.</p>
Table of Contents (16 chapters)
Magento PHP Developer's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

EAV Model


EAV stands for entity, attribute, and value, it is probably the most difficult concept for new Magento developers to grasp. While the EAV concept is not unique to Magento, it is rarely implemented on modern systems, on top of that, Magento implementation is not a simple one.

What is EAV?

In order to understand what EAV is and what its role within Magento is, we need to break down it into the parts of the EAV model.

  • Entity: The entity represents the data items (objects) inside Magento products, customers, categories, and orders. Each entity is stored in the database with a unique ID.

  • Attribute: These are our object properties. Instead of having one column per attribute on the product table, attributes are stored on separates sets of tables.

  • Value: As the name implies, it is simply the value link to a particular attribute.

This design pattern is the secret behind Magento's flexibility and power, allowing entities to add and remove new properties without having to do any changes to the...