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

Chapter 3. ORM and Data Collections

Collections and models are the bread and butter of everyday Magento development. In this chapter, we will introduce the reader to the Magento ORM system, and we will learn how to properly work with data collections and the EAV system. As with most modern systems, Magento implements an Object Relational Mapping (ORM) system.

Object-relational mapping (ORM, O/RM, and O/R mapping) in computer software is a programming technique for converting data between incompatible type systems in object-oriented programming languages. This creates, in effect, a "virtual object database" that can be used from within the programming language.

In this chapter, we will cover the following topics:

  • Magento Models

  • Anatomy of a Magento Data Model

  • EAV and EAV models

  • Working with Direct SQL queries

We will also be working with several snippets of code to provide an easy framework to experiment and play around with Magento.

Note

Note that the interactive examples in this chapter assume you...