7
Magento的構造其SQL查詢,如如何將Magento sql查詢顯示爲字符串?
$this->getSelect()->joinInner(
array('sbao' => $this->getTable('sales/billing_agreement_order')),
'main_table.entity_id = sbao.order_id',
array()
)
有沒有顯示字符串格式生成的查詢,而不是如打印出的巨大物體的方式
echo $this->getSelect()->joinInner(
array('sbao' => $this->getTable('sales/billing_agreement_order')),
'main_table.entity_id = sbao.order_id',
array()
)->toString();
回聲剛好夠,因爲它有它自己的toString方法 – 2011-01-13 13:02:28
,有時你需要轉換其自動觸發`__toString`方法。類似`echo(string)$ this-> getSelect ...' – clockworkgeek 2011-01-13 13:24:55