yii\sphinx\QueryBuilder::buildCondition PHP Метод

buildCondition() публичный Метод

Parses the condition specification and generates the corresponding SQL expression.
public buildCondition ( IndexSchema[] $indexes, string | array $condition, array &$params ) : string
$indexes IndexSchema[] list of indexes, which affected by query
$condition string | array the condition specification. Please refer to [[Query::where()]] on how to specify a condition.
$params array the binding parameters to be populated
Результат string the generated SQL expression
    public function buildCondition($indexes, $condition, &$params)
    {
        if (!is_array($condition)) {
            return (string) $condition;
        } elseif (empty($condition)) {
            return '';
        }
        if (isset($condition[0])) {
            // operator format: operator, operand 1, operand 2, ...
            $operator = strtoupper($condition[0]);
            if (isset($this->conditionBuilders[$operator])) {
                $method = $this->conditionBuilders[$operator];
            } else {
                $method = 'buildSimpleCondition';
            }
            array_shift($condition);
            return $this->{$method}($indexes, $operator, $condition, $params);
        }
        // hash format: 'column1' => 'value1', 'column2' => 'value2', ...
        return $this->buildHashCondition($indexes, $condition, $params);
    }