15

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.

  • 1
    Did you manage to find an answer that covered your question? – Sander Mangel Feb 24 '14 at 21:03
10

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

  • Could you tell me what are the three type of models in magento ? – VijayS91 Feb 20 '14 at 9:25
  • Updated the answer. – Fabian Blechschmidt Feb 20 '14 at 9:35
9

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.

  • Bummer the PDF link no longer available. – philwinkle Jul 15 '16 at 13:30
  • It looks like the Magento RDBMS Guide is depreciated. A little but of searching doesn't turn up much as far as reliable (or legal???) copies of it. So if it's old, remove it. Don't replace it......... – circlesix Jul 30 '16 at 17:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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