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
$keyis numeric and$valueis a string,$valueis treated as a literal SQL fragment and returned.
Parameters
-
string|array
$conditionsThe havings for this query.
-
object
$contextThe current
lithium\data\model\Queryinstance. -
array
$optionsAvailable options are:
'prepend'boolean|string: The string to prepend orfalsefor 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);
}