开发者

Magento: Get collection from custom query

开发者 https://www.devze.com 2023-04-02 00:45 出处:网络
We can write a custom query in Magento: $write = Mage::getSingleton(\'core/resource\')->getConnection(\'core_write\');

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消