从Magento集合输出原始SQL查询

从Magento集合输出原始SQL查询,magento,magento-1.7,Magento,Magento 1.7,我有以下集合,希望在IDE Xdebug工具中查看原始SQL- $collection = Mage::getResourceModel('rp/organisation_collection') ->searchByPostcodeLastname($postcode, Slastname) ->addFieldToSelect(array('organisation_id')) -&g

我有以下集合,希望在IDE Xdebug工具中查看原始SQL-

$collection = Mage::getResourceModel('rp/organisation_collection')
                ->searchByPostcodeLastname($postcode, Slastname)
                ->addFieldToSelect(array('organisation_id'))
                ->setPageSize(1);

$qry = $organisation->load()->getSelect();
这表明Varien对象似乎没有提供原始SQL供我检查-有人能确认我做错了什么吗?

试试看

$collection->getSelect()->\uuuu toString()


请参见试用
$Collection->printLogQuery(true)这将打印集合查询

Mage::log($collection->getSelect(),null,'test.log',true);