ORM means "Object Relational Mapping."
it is a technique that we basically used to convert types of data to an Objects
Also as converting any objects to data.
Magento, ORM is stands as Model (which is based on Zend Framework Zend_Db_Adapter)
Generally there are two kind of models in magneto first is Simple and second is EAV.
Simple Models : Simple Or we can also call it Regular Models is a flat table or simple regular table structure.
EAV (Entity Attribute Value): It is more complicated and also too expensive to any query.
Basically all the Magento Models those are interacting with database are simply inherited from the Mage_Core_Model_Abstract class, and this class is inherited from Varien_Object.
General difference between these two Models as mentioned is, the simple Model inherited from Mage_Core_Model_Resource_Db_Abstract class, while the EAV inherited from Mage_Eav_Model_Entity_Abstract class.
For getting some data in Magento, we use it like :
Mage::getModel('module/model')->load(1);
Here 1 is a primary key id for any simple table, and if we see other model that is in EAV there we have many tables those are joined to fetch a data of single row.
0 Comment(s)