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