Hi,
I have written a module to add my own events, and in the home page i would like to show only latest events. So in that case i have to add order by to query but i couldnot do that, it always throws fatal error.
This is what i have done.
$_offers = Mage::getSingleton('offerings/offerings')->getCollection();
This returns all the records, here i could able to set filter options but i could not add sort order like this
$_offers = Mage::getModel('offerings/offerings')->getCollection()
->addAttributeToSort('offerings_id', 'DESC')
->setPageSize(5)
->setPage(1, 5);
or even using Mage::getSingleton. Whats the problem here am facing. Please help me