Skip to content

Commit df98a22

Browse files
avalanche123fabpot
authored andcommitted
[DoctrineMongoDBBundle] added support for more Mongo and ODM types
1 parent 2f8db91 commit df98a22

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Symfony/Bundle/DoctrineMongoDBBundle/Logger/DoctrineMongoDBLogger.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,16 @@ static protected function formatQuery(array $query)
6060
$formatted = 'ObjectId("'.$value.'")';
6161
} elseif ($value instanceof \MongoDate) {
6262
$formatted = 'new Date("'.date('r', $value->sec).'")';
63+
} elseif ($value instanceof \DateTime) {
64+
$formatted = 'new Date("'.date('r', $value->getTimestamp()).'")';
6365
} elseif ($value instanceof \MongoRegex) {
6466
$formatted = 'new RegExp("'.$value->regex.'", "'.$value->flags.'")';
67+
} elseif ($value instanceof \MongoMinKey) {
68+
$formatted = 'new MinKey()';
69+
} elseif ($value instanceof \MongoMaxKey) {
70+
$formatted = 'new MaxKey()';
71+
} elseif ($value instanceof \MongoBinData) {
72+
$formatted = 'new BinData("'.$formatted->bin.'", "'.$formatted->type.'")';
6573
} else {
6674
$formatted = (string) $value;
6775
}

0 commit comments

Comments
 (0)