Search code examples
magentocollectionsmoduleadminhtml

New Magento backend functionality


I'm following this tutorial. The tutorial isn't 100% complete and leaves the user to fill in some of the gaps. I'm fine with that. The part that breaks is $collection = Mage::getModel('employee/employee')->getCollection();. I'm assuming this is because I'm asking Magento to call a customer getCollection method which I need to define. I've looked through and can't seem to find an example of how to create a collection file.

Can anyone point me to a few examples?

Thank you.


Solution

  • Thank you WojtekT. I was missing this piece from my etc/config.xml

        <models>
            <categoryrules>
                <class>Rogue_CategoryRules_Model</class>
                <resourceModel>categoryrules_mysql4</resourceModel>
            </categoryrules>
            <categoryrules_mysql4>
                <class>Rogue_CategoryRules_Model_Mysql4</class>
                <entities>
                    <rules>
                        <table>rogue_category_rules</table>
                    </rules>
                </entities>
            </categoryrules_mysql4>
        </models>