lithium\data\source\Database::having()
Returns a string of formatted havings to be inserted into the query statement. If the query havings are defined as an array, key pairs are converted to SQL strings.
Conversion rules are as follows:
- If
$key
is numeric and$value
is a string,$value
is treated as a literal SQL fragment and returned.
Parameters
-
string|array
$conditions
The havings for this query.
-
object
$context
The current
lithium\data\model\Query
instance. -
array
$options
Available options are:
'prepend'
boolean|string: The string to prepend orfalse
for no prepending. Defaults to'HAVING'
.
Returns
stringReturns the HAVING
clause of an SQL query.
Source
public function having($conditions, $context, array $options = []) {
$defaults = ['prepend' => 'HAVING'];
$options += $defaults;
return $this->_conditions($conditions, $context, $options);
}