Force the constraint to only support the passed operator(s).

@param array|string $operators

@return self
350152
public function allowOperators($operators)
    {
        $operators = is_array($operators) ? $operators : func_get_args();
        if ($this->allowedOperators && $this->allowedOperators != $operators) {
            throw new BadMethodCallException('You can only set the allowed operators once.');
        }
        $this->allowedOperators = $operators;
        return $this->setOperator($this->operator);
    }
1056895
private function operator(string $operator, $expression) : self
    {
        if ($this->currentField) {
            $this->expr[$this->currentField][$operator] = $this->ensureArray($expression);
        } else {
            $this->expr[$operator] = $this->ensureArray($expression);
        }

        return $this;
    }
1031135
public static function compare($version1, $operator, $version2)
    {
        $constraint = new Constraint($operator, $version2);

        return $constraint->matches(new Constraint('==', $version1));
    }
841790
public function setStackOperations(array $operations)
    {
        $this->stackOperations = [];
        foreach ($operations as $operation) {
            $this->addStackOperation($operation);
        }

        return $this;
    }
783584
public function whereColumn($a, $operator, $b = null)
    {
        $constraint = call_user_func_array(
            [Constraint::class, 'whereColumn'],
            func_get_args()
        );

        return $this->addConstraint($constraint);
    }
465092
private function addOperator($operator, $field, $value) {
		$this->is($field, array('$' . $operator => $value));
		
		return $this;
	}
346476
protected function buildConstraints($values)
    {
        if (is_array($values)) {
            $constraints = [];
            foreach ($values as $value) {
                $constraints[] = Constraint::make($value);
            }
            return $constraints;
        } else {
            return Constraint::make($values);
        }
    }
703428
public function orRelation($column1, $operator, $column2 = null)
    {
        if (func_num_args() < 3) {
            $column2 = $operator;

            $operator = null;
        }

        $this->addRelation('OR', $column1, $operator, $column2);

        return $this;
    }
1213286
private function _where($operator, array $fields)
    {
        $count = count($fields);

        if ($count < 1 || $count > 3)
        {
            $fields = var_export($fields, true);
            throw new \InvalidArgumentException($fields);
        }

        $this->storageWhere[] = [$operator => $fields];

        return $this;
    }
504410
public function not($expression) : self
    {
        return $this->operator('$not', $expression instanceof Expr ? $expression->getQuery() : $expression);
    }
604412
public static function create(array $constraints): ValidationClassMappingBuilderInterface
    {
        $self = new self();
        $self->constraints = [];
        foreach ($constraints as $constraint) {
            $self->addConstraint($constraint);
        }

        return $self;
    }
63601
public function setFieldOperator(string $field, string $operator = self::OPERATOR_OR): self
    {
        return $this->setFieldParam($field, 'operator', $operator);
    }
943337
public static function getOperator($type, $operator)
    {
        $operators = self::getOperators($type);

        return Arr::get($operators, $operator, []);
    }
231239
public function setOperators(array $operators)
    {
        $invalid = [];
        if (!$this->validateOperators($operators, $invalid)) {
            throw new \InvalidArgumentException(\sprintf('Trying to set invalid operator(s) "%s" for filter "%s"', \implode(', ', $operators), $this->getName()));
        }
        $this->operators = $operators;

        return $this;
    }
267884
public static function where($column, $operator, $value = null)
    {
        list($operator, $value) = static::prepareOperatorAndValue(
            $operator, $value, func_num_args() === 2
        );

        return new ValueConstraint($column, $operator, $value);
    }
926267
public function and(string $field, string $operator, string $field2)
    {
        $this->addClause(
            'where',
            compact('field', 'operator', 'field2')
        );

        return $this;
    }
654918
public function has($relation, $operator = '>=', $count = 1)
    {
        $this->hasRelations[$relation] = [$operator, $count];

        return $this;
    }