Commit d696ff2f authored by Jens's avatar Jens

More compiles

parent 9c63366f
......@@ -24,6 +24,7 @@ class Query extends \Illuminate\Database\Query\Builder {
'>' => '$gt',
'>=' => '$ge',
'in' => '$in',
'exists' => '$exists'
);
/**
......@@ -260,4 +261,32 @@ class Query extends \Illuminate\Database\Query\Builder {
return array($column => array($this->operators['in'] => $values));
}
}
\ No newline at end of file
public function compileWhereNull($where)
{
extract($where);
// Convert id's
if ($column == '_id')
{
foreach ($values as &$value)
$value = ($value instanceof MongoID) ? $value : new MongoID($value);
}
return array($column => array($this->operators['exists'] => false));
}
public function compileWhereNotNull($where)
{
extract($where);
// Convert id's
if ($column == '_id')
{
foreach ($values as &$value)
$value = ($value instanceof MongoID) ? $value : new MongoID($value);
}
return array($column => array($this->operators['exists'] => true));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment