【发布时间】:2018-07-14 02:18:55
【问题描述】:
如何从 CakePHP 3 中的查询对象中获取“参数”?
$response = $this->getTable()->find();
// there are beforeFinds...etc that make this more complex
当我调试 $response 时,我得到了这个 (:
// ...
'(help)' => 'This is a Query object, to get the results execute or iterate it.',
'sql' => 'SELECT .... WHERE ... article_id = :c2',
'params' => [
':c0' => [
[maximum depth reached]
],
':c1' => [
[maximum depth reached]
],
':c2' => [
[maximum depth reached]
]
],
// ...
我想知道:c2 的值是什么,但我似乎无法让params 进行调试。
我试过这些:
\Cake\Error\Debugger::log($response->params);
\Cake\Error\Debugger::log($response->params());
\Cake\Error\Debugger::log($response['params']);
\Cake\Error\Debugger::log($response->getParams());
\Cake\Error\Debugger::log($response->getQueryParams());
但没有任何工作。
【问题讨论】:
标签: php object cakephp cakephp-3.x cakephp-3.4