Commit e8027c71 authored by Jens Segers's avatar Jens Segers

Small tweaks

parent 3f1be668
......@@ -8,7 +8,7 @@ class Builder extends \Illuminate\Database\Query\Builder {
/**
* The database collection
*
* @var string
* @var MongoCollection
*/
public $collection;
......@@ -247,8 +247,6 @@ class Builder extends \Illuminate\Database\Query\Builder {
$this->wheres[] = compact('column', 'type', 'boolean', 'values');
$this->bindings = array_merge($this->bindings, $values);
return $this;
}
......@@ -366,8 +364,7 @@ class Builder extends \Illuminate\Database\Query\Builder {
*/
public function delete($id = null)
{
$query = $this->compileWheres();
$result = $this->collection->remove($query);
$result = $this->collection->remove($this->compileWheres());
if (1 == (int) $result['ok'])
{
......@@ -405,6 +402,16 @@ class Builder extends \Illuminate\Database\Query\Builder {
return (1 == (int) $result['ok']);
}
/**
* Get a new instance of the query builder.
*
* @return Builder
*/
public function newQuery()
{
return new Builder($this->connection);
}
/**
* Compile the where array
*
......@@ -414,6 +421,7 @@ class Builder extends \Illuminate\Database\Query\Builder {
{
if (!$this->wheres) return array();
// The new list of compiled wheres
$wheres = array();
foreach ($this->wheres as $i=>&$where)
......@@ -535,14 +543,4 @@ class Builder extends \Illuminate\Database\Query\Builder {
);
}
/**
* Get a new instance of the query builder.
*
* @return Builder
*/
public function newQuery()
{
return new Builder($this->connection);
}
}
\ No newline at end of file
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