如何将 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();
Magento constructs its SQL queries like
$this->getSelect()->joinInner(
array('sbao' => $this->getTable('sales/billing_agreement_order')),
'main_table.entity_id = sbao.order_id',
array()
)
Is there a way to display the resulting query in a string format rather than printing out the huge object e.g.
echo $this->getSelect()->joinInner(
array('sbao' => $this->getTable('sales/billing_agreement_order')),
'main_table.entity_id = sbao.order_id',
array()
)->toString();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我几乎已经为那些感兴趣的人提供了它,您需要使用 ->__toString() 例如
I nearly had it for those interested you need to use ->__toString() e.g.