yii\sphinx\MatchBuilder::buildMatch PHP Метод

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

Create MATCH expression.
public buildMatch ( string | array $match, array &$params ) : string
$match string | array MATCH specification.
$params array the expression parameters to be populated
Результат string the MATCH expression
    public function buildMatch($match, &$params)
    {
        if (empty($match)) {
            return '';
        }
        if ($match instanceof Expression) {
            return $this->buildMatchValue($match, $params);
        }
        if (!is_array($match)) {
            return $match;
        }
        if (isset($match[0])) {
            // operator format: operator, operand 1, operand 2, ...
            $operator = strtoupper($match[0]);
            if (isset($this->matchBuilders[$operator])) {
                $method = $this->matchBuilders[$operator];
            } else {
                $method = 'buildSimpleMatch';
            }
            array_shift($match);
            return $this->{$method}($operator, $match, $params);
        }
        // hash format: 'column1' => 'value1', 'column2' => 'value2', ...
        return $this->buildHashMatch($match, $params);
    }