lithium\data\source\Database::conditions()
Returns a string of formatted conditions to be inserted into the query statement. If the query conditions 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 conditions 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'WHERE'.
Returns
stringReturns the WHERE clause of an SQL query.
Source
public function conditions($conditions, $context, array $options = []) {
$defaults = ['prepend' => 'WHERE'];
$options += $defaults;
return $this->_conditions($conditions, $context, $options);
}