Book Image

Magento PHP Developer????s Guide, 2nd Edition

By : Allan MacGregor
Book Image

Magento PHP Developer????s Guide, 2nd Edition

By: Allan MacGregor

Overview of this book

Table of Contents (16 chapters)
Magento PHP Developer's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 2. 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 work with data collections and the EAV system properly. As 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

The interactive examples in this chapter assume you are working...