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

Using Direct SQL


So far, we have learned how Magento data models and the ORM system provide a clean and simple way to access, store, and manipulate our data. Before we jump right into this section, learn about the Magento database adapters, and how to run raw SQL queries, I feel it is important that we understand why you should avoid as much as possible to use what you are about to learn in this section.

Magento is an extremely complex system, and as we've also learned in the previous chapter, a framework is driven in part by events; just saving a product will trigger different events, each doing a different task. This will not happen if you decide to just create a query and update a product directly. So, as developers, we have to be extremely careful and sure whether there is a justifiable reason for going outside the ORM.

That said, there are, of course, scenarios when being able to work with the database directly comes in extremely handy and is actually simpler than working with the Magento...