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

_processOperator() protected method

Helper method used by _processConditions.
protected _processOperator ( $key, $value, $fieldMeta, $glue ) : mixed
return mixed Returns the operator expression string or `false` if no operator is applicable.
    protected function _processOperator($key, $value, $fieldMeta, $glue)
    {
        if (!is_string($key) || !is_array($value)) {
            return false;
        }
        $operator = strtoupper(key($value));
        if (!is_numeric($operator)) {
            if (!isset($this->_operators[$operator])) {
                throw new QueryException("Unsupported operator `{$operator}`.");
            }
            foreach ($value as $op => $val) {
                $result[] = $this->_operator($key, array($op => $val), $fieldMeta);
            }
            return '(' . implode(' ' . $glue . ' ', $result) . ')';
        }
        return false;
    }