Using Direct SQL
So far we have learned how Magento data models and ORM systems provide a clean and simple way to access, store, and manipulate our data. Before we jump right into this section and 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 using what you are about to learn in this section as much as possible.
Magento is an extremely complex system, and as we've also learned in the previous chapter, a framework driven in part by events. Just saving a product will trigger half a dozen 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 must be extremely ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access