1 select.inc | public SelectQueryExtender::havingCondition($field, $value = NULL, $operator = '=') |
Helper function to build most common HAVING conditional clauses.
This method can take a variable number of parameters. If called with two parameters, they are taken as $field and $value with $operator having a value of IN if $value is an array and = otherwise.
Parameters
string $field: The name of the field to check. If you would like to add a more complex condition involving operators or functions, use having().
mixed $value: The value to test the field against. In most cases, this is a scalar. For more complex options, it is an array. The meaning of each element in the array is dependent on the $operator.
string|null $operator: The comparison operator, such as =, <, or >=. It also accepts more complex options such as IN, LIKE, or BETWEEN. Defaults to IN if $value is an array, and = otherwise.
Return value
QueryConditionInterface: The called object.
Overrides SelectQueryInterface::havingCondition
File
- core/
includes/ database/ select.inc, line 719 - Contains classes and interfaces for Select queries.
Class
- SelectQueryExtender
- The base extender class for Select queries.
Code
public function havingCondition($field, $value = NULL, $operator = '=') {
$this->query->havingCondition($field, $value, $operator);
return $this;
}