Magento: Get collection from custom query
We can write a custom query in Magento:
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$write->query("insert into tablename values ('aaa','bbb','ccc')");
Now how can I get the output of query into a collection as I get from Mage::getModel()->getColl开发者_开发问答ection
?
Create an object that extends one of the base collection objects, and add your query to the load method.
精彩评论