magento:Fatal error: Call to undefined method ::getCollection()

When i try to collect the datas from my custom module, I got the following Error


I have already created several custom module and perform data collection with attribute filter too.

But in this situation, It makes me a mad! I have stayed here without an answer around half an hour!

But The answer is so simple!

$collection = Mage::getResourceModel(‘bannerslider/banner’)->getCollection();

I wrote a code like above instead of

$collection = Mage::getModel(‘bannerslider/banner’)->getCollection();

Now the Error was gone! đŸ™‚

Otherwise you can simply call $collection = Mage::getResourceModel(‘bannerslider/banner’);


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s