What is the purpose of using these two models collection.
- Resource
- Mysql4
why can't we use resource model for all collections.
Why we are using MySql4 collection for simple module
Some one explain.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityWhat is the purpose of using these two models collection.
why can't we use resource model for all collections.
Why we are using MySql4 collection for simple module
Some one explain.
I would say in magento 1.8 all collections are resource collections.
Resource collections depend on generic implementations for all the SQL-stuff. the idea is to only reimplement the base class to offer support for another sql database, like postgre, oracle or mssql.
The still existing Mysql4 classes are only for backwards compatibility but only extend the resource collection
Update:
Could you tell me what are the three type of models in magento ?
I'm not sure about this, but I would say you are maybe talking about Models (extending Mage_Core_Model_Abstract
), Resource Models (extending Mage_Core_Model_Resource_Db_Abstract
) and Collections (extending Mage_Core_Model_Resource_Db_Collection_Abstract
).
Mysql4
was deprecated after Magento CE 1.6. This answer gives some more information about it. A bit more lengthy explanation can be found in this PDF.
Still, using Mysql4
classes shouldn't be an issue since it should be backwards compatible.