lithium\data\source\Database::conditions()

public method

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 $key is numeric and $value is a string, $value is treated as a literal SQL fragment and returned.

Parameters

  • string|array $conditions

    The conditions for this query.

  • object $context

    The current lithium\data\model\Query instance.

  • array $options

    Available options are:

    • 'prepend' boolean|string: The string to prepend or false for no prepending. Defaults to 'WHERE'.

Returns

string

Returns 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);
	}