What is A Resource Model?
A resource model is a model that is responsible for the CRUD (Create, Read, Update, Delete) implementations for the Magento ORM. In simple terms, it is used to process your data from your model to your database. Models hold your data. Resource models do something with that data. [Read more…]
What Are Models?
Models are a flexible, highly abstract class that represents business logic in your application. Models in Magento 2 can be anything that is packaged up and labeled. For instance, database tables are representative of models.
Magento’s ORM demands that only models can work with data in the application. Models in the scope of ORM are the data containers for your module. This means that model classes hold and transport data throughout your application. Do not confuse this with Resource models, which we will cover in another tutorial. [Read more…]
Whenever you needed alterations done in Magento 1, you had to create installation and upgrade scripts. These scripts were generally used to create database tables, add EAV attributes and manipulate data inside of the database. This was incredibly useful to automatically run all the alterations you need in the database.
Magento 2 brings this feature back, with some welcome changes. [Read more…]