Cml\Db\MongoDB\MongoDB::debugLogSql PHP Method

debugLogSql() private method

Debug模式记录查询语句显示到控制台
private debugLogSql ( string $type = 'Query', string $tableName, array $condition = [], array $options = [] )
$type string 查询的类型
$tableName string 查询的Collection
$condition array 条件
$options array 额外参数
    private function debugLogSql($type = 'Query', $tableName, $condition = [], $options = [])
    {
        if (Cml::$debug) {
            Debug::addSqlInfo(sprintf("[MongoDB {$type}] Collection: %s, Condition: %s, Other: %s", $this->getDbName() . ".{$tableName}", json_encode($condition, PHP_VERSION >= '5.4.0' ? JSON_UNESCAPED_UNICODE : 0), json_encode($options, PHP_VERSION >= '5.4.0' ? JSON_UNESCAPED_UNICODE : 0)));
        }
    }