yii\mongodb\QueryBuilder::buildLikeCondition PHP Метод

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

Creates a Mongo condition, which emulates the LIKE operator.
public buildLikeCondition ( string $operator, array $operands ) : array
$operator string the operator to use
$operands array the first operand is the column name. The second operand is a single value that column value should be compared with.
Результат array the generated Mongo condition.
    public function buildLikeCondition($operator, $operands)
    {
        if (!isset($operands[0], $operands[1])) {
            throw new InvalidParamException("Operator '{$operator}' requires two operands.");
        }
        list($column, $value) = $operands;
        if (!$value instanceof Regex) {
            $value = new Regex(preg_quote($value), 'i');
        }
        return [$column => $value];
    }