从 CDbCriteria 获取字符串表示 [英] Getting the string representation from CDbCriteria
本文介绍了从 CDbCriteria 获取字符串表示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有什么方法可以从 CDbCriteria?用于测试和调试目的.
Is there any way to the get the string representation of the query from CDbCriteria? For testing and debugging purposes.
推荐答案
您可以使用日志记录和分析配置您的 main.php,如下所示:
You can use logging and profiling configuring your main.php like this:
'components'=>array(
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CWebLogRoute',
'categories'=>'system.db.CDbCommand',
'showInFireBug'=>true,
),
),
),
'db'=>array(
'enableProfiling'=>true,
'enableParamLogging'=>true,
),
),
这篇关于从 CDbCriteria 获取字符串表示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文