I have declared the model, resources in file config.xml, then i try to create necessary files for module. there are 3 files:

  • app/code/local/MW/SimpleNews/Model/News.php

  • app/code/local/MW/SimpleNews/Model/Mysql4/News.php

  • app/code/local/MW/SimpleNews/Model/Mysql4/News/Collection.php

But I don't know how to make these files correspondent with the table.

Please help

  • Mysql4 is deprecated so use resource instead of it. Use this official magento extension development guideline as a reference to develop the magento extensions.
    – user722
    Commented Sep 15, 2014 at 6:10

1 Answer 1


Your files seems correct. However you need to configure set up resource in order to integrate custom table with your module. Set up resource is used to declare, update tables associated with a module.

For this, you need to set up resource for your module in config.xml and then in the root directory of your module, you need to create sql\<module>_setup\install.<version_number>.php file.

You can use this official tutorial as a reference

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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