Take the 2-minute tour ×
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

What is the purpose of using these two models collection.

  1. Resource
  2. Mysql4

why can't we use resource model for all collections.

Why we are using MySql4 collection for simple module

Some one explain.

share|improve this question
    
Did you manage to find an answer that covered your question? –  Sander Mangel Feb 24 at 21:03

2 Answers 2

up vote 6 down vote accepted

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).

share|improve this answer
    
Could you tell me what are the three type of models in magento ? –  Vijay S Feb 20 at 9:25
    
Updated the answer. –  Fabian Blechschmidt Feb 20 at 9:35
    
Thanks for updating answer.. –  Vijay S Feb 20 at 10:05

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.