Commit d887e4fb authored by Tom Lindelius's avatar Tom Lindelius

Added support for a whereAll query

parent b9d99c61
......@@ -491,6 +491,24 @@ class Builder extends BaseBuilder
return $this;
}
/**
* Add a "where all" clause to the query.
*
* @param string $column
* @param array $values
* @param string $boolean
* @param bool $not
* @return $this
*/
public function whereAll($column, array $values, $boolean = 'and', $not = false)
{
$type = 'all';
$this->wheres[] = compact('column', 'type', 'boolean', 'values', 'not');
return $this;
}
/**
* @inheritdoc
*/
......@@ -923,6 +941,17 @@ class Builder extends BaseBuilder
return $compiled;
}
/**
* @param array $where
* @return array
*/
protected function compileWhereAll(array $where)
{
extract($where);
return [$column => ['$all' => array_values($values)]];
}
/**
* @param array $where
* @return array
......
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