[DoctrineMongoDBBundle] updated logging to support new embedded document in \stdClass
This commit is contained in:
parent
d693759312
commit
92653bf827
@ -7,7 +7,7 @@ use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
/**
|
||||
* Logger for the Doctrine MongoDB ODM.
|
||||
*
|
||||
*
|
||||
* @author Kris Wallsmith <kris.wallsmith@symfony-project.com>
|
||||
*/
|
||||
class DoctrineMongoDBLogger
|
||||
@ -63,16 +63,15 @@ class DoctrineMongoDBLogger
|
||||
|
||||
/**
|
||||
* Formats the supplied query array recursively.
|
||||
*
|
||||
*
|
||||
* @param array $query All or part of a query array
|
||||
*
|
||||
*
|
||||
* @return string A serialized object for the log
|
||||
*/
|
||||
static protected function formatQuery(array $query)
|
||||
static protected function formatQuery(array $query, $array = true)
|
||||
{
|
||||
$parts = array();
|
||||
|
||||
$array = true;
|
||||
foreach ($query as $key => $value) {
|
||||
if (!is_numeric($key)) {
|
||||
$array = false;
|
||||
@ -98,6 +97,8 @@ class DoctrineMongoDBLogger
|
||||
$formatted = 'new MaxKey()';
|
||||
} elseif ($value instanceof \MongoBinData) {
|
||||
$formatted = 'new BinData("'.$value->bin.'", "'.$value->type.'")';
|
||||
} elseif ($value instanceof \stdClass) {
|
||||
$formatted = static::formatQuery((array) $value, false);
|
||||
} else {
|
||||
$formatted = (string) $value;
|
||||
}
|
||||
|
Reference in New Issue
Block a user