Skip to content

Commit

Permalink
[DoctrineMongoDBBundle] added support for more Mongo and ODM types
Browse files Browse the repository at this point in the history
  • Loading branch information
avalanche123 authored and fabpot committed Sep 6, 2010
1 parent 2f8db91 commit df98a22
Showing 1 changed file with 8 additions and 0 deletions.
Expand Up @@ -60,8 +60,16 @@ static protected function formatQuery(array $query)
$formatted = 'ObjectId("'.$value.'")';
} elseif ($value instanceof \MongoDate) {
$formatted = 'new Date("'.date('r', $value->sec).'")';
} elseif ($value instanceof \DateTime) {
$formatted = 'new Date("'.date('r', $value->getTimestamp()).'")';
} elseif ($value instanceof \MongoRegex) {
$formatted = 'new RegExp("'.$value->regex.'", "'.$value->flags.'")';
} elseif ($value instanceof \MongoMinKey) {
$formatted = 'new MinKey()';
} elseif ($value instanceof \MongoMaxKey) {
$formatted = 'new MaxKey()';
} elseif ($value instanceof \MongoBinData) {
$formatted = 'new BinData("'.$formatted->bin.'", "'.$formatted->type.'")';
} else {
$formatted = (string) $value;
}
Expand Down

0 comments on commit df98a22

Please sign in to comment.