从Magento集合输出原始SQL查询
问题描述:
我有以下收藏,并希望在我的IDE Xdebug工具中查看原始SQL-
I have the following collection and want to view the raw SQL within my IDE Xdebug tool -
$collection = Mage::getResourceModel('rp/organisation_collection')
->searchByPostcodeLastname($postcode, Slastname)
->addFieldToSelect(array('organisation_id'))
->setPageSize(1);
$qry = $organisation->load()->getSelect();
这虽然显示Varien对象似乎并没有给我原始SQL供我检查-有人可以确认我做错了吗?
This while does show the Varien object doesn't seem to give me the raw SQL for me to check - can someone confirm what I am doing wrong?
答
尝试
$ collection-> getSelect()-> __ toString()
$collection->getSelect()->__toString()