lithium\data\source\Database::constraints PHP Method

constraints() public method

If the query constraints are defined as an array, key pairs are converted to SQL strings. If $key is numeric and $value is a string, $value is treated as a literal SQL fragment and returned.
public constraints ( string | array $constraints, Query $context, array $options = [] ) : string
$constraints string | array The constraints for a `ON` clause.
$context lithium\data\model\Query
$options array Available options are: - `'prepend'` _boolean|string_: The string to prepend or `false` for no prepending. Defaults to `'ON'`.
return string Returns the `ON` clause of an SQL query.
    public function constraints($constraints, $context, array $options = array())
    {
        $defaults = array('prepend' => 'ON');
        $options += $defaults;
        if (is_array($constraints)) {
            $constraints = $this->_constraints($constraints);
        }
        return $this->_conditions($constraints, $context, $options);
    }