本文整理匯總了PHP中DboSource::logQuery方法的典型用法代碼示例。如果您正苦於以下問題:PHP DboSource::logQuery方法的具體用法?PHP DboSource::logQuery怎麽用?PHP DboSource::logQuery使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DboSource
的用法示例。
在下文中一共展示了DboSource::logQuery方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: logQuery
/**
* logQuery method
*
* Set timers, errors and refer to the parent
* If there are arguments passed - inject them into the query
* Show MongoIds in a copy-and-paste-into-mongo format
*
*
* @param mixed $query
* @param array $args array()
* @return void
* @access public
*/
public function logQuery($query, $args = array()) {
if ($args) {
$this->_stringify($args);
$query = String::insert($query, $args);
}
$this->took = round((microtime(true) - $this->_startTime) * 1000, 0);
$this->affected = null;
if (empty($this->error['err'])) {
$this->error = $this->_db->lastError();
if (!is_scalar($this->error)) {
$this->error = json_encode($this->error);
}
}
$this->numRows = !empty($args['count']) ? $args['count'] : null;
$query = preg_replace('@"ObjectId\((.*?)\)"@', 'ObjectId ("\1")', $query);
return parent::logQuery($query);
}
示例2: logQuery
/**
* logQuery method
*
* Set timers, errors and refer to the parent
* If there are arguments passed - inject them into the query
* Show MongoIds in a copy-and-paste-into-mongo format
*
*
* @param mixed $query
* @param array $args array()
* @return void
* @access public
*/
public function logQuery($query, $args = array())
{
if ($args) {
$this->_stringify($args);
$query = CakeText::insert($query, $args);
}
$this->took = round((microtime(true) - $this->_startTime) * 1000, 0);
$this->affected = null;
$this->numRows = !empty($args['count']) ? $args['count'] : null;
$query = preg_replace('@"ObjectId\\((.*?)\\)"@', 'ObjectId ("\\1")', $query);
return parent::logQuery($query);
}