Adding having() support to the Fluent query builder.
Signed-off-by: Ben Corlett <bencorlett@me.com>
This commit is contained in:
@@ -70,6 +70,13 @@ class Query {
|
||||
*/
|
||||
public $groupings;
|
||||
|
||||
/**
|
||||
* The HAVING clauses.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $havings;
|
||||
|
||||
/**
|
||||
* The ORDER BY clauses.
|
||||
*
|
||||
@@ -475,6 +482,22 @@ class Query {
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a having to the query.
|
||||
*
|
||||
* @param string $column
|
||||
* @param string $operator
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function having($column, $operator, $value)
|
||||
{
|
||||
$this->havings[] = compact('column', 'operator', 'value');
|
||||
|
||||
$this->bindings[] = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an ordering to the query.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user