Commit 8c17827d authored by Jens Segers's avatar Jens Segers Committed by GitHub

Merge pull request #1320 from lindelius/master

Added support for "whereAll" queries
parents b9d99c61 d887e4fb
......@@ -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