Return a valid mutator name or throw an exceptions.

@param string $name
@param string $operator

@throws DynamicMutatorNotDefinedException

@return string
344996
protected function mutatorNameOrFail(string $name, string $operator): string
    {
        if (! $this->hasMutator($name, $operator)) {
            throw new DynamicMutatorNotDefinedException('Mutator not defined!', 0, null, [
                'name'     => $name,
                'operator' => $operator,
                'handler'  => $this->getName(),
            ]);
        }

        return $name;
    }
76617
public function defineInlineOperator(string $operator, callable $transformer)
    {
        unset($this->operators[$operator]);
        $this->inlineOperators[$operator] = $transformer;
    }
575410
private function getDynamoDbOperator(IndexQueryFilterOperator $operator): string
    {
        switch ($operator->getValue()) {
            case IndexQueryFilterOperator::EQUAL_TO:
                return '=';

            case IndexQueryFilterOperator::NOT_EQUAL_TO:
                return '<>';

            case IndexQueryFilterOperator::GREATER_THAN:
                return '>';

            case IndexQueryFilterOperator::GREATER_THAN_OR_EQUAL_TO:
                return '>=';

            case IndexQueryFilterOperator::LESS_THAN:
                return '<';

            case IndexQueryFilterOperator::LESS_THAN_OR_EQUAL_TO:
                return '<=';

            default:
                return '=';
        }
    }
714875
public function setByValueOperator($operator = 'OR')
    {
        if ($operator != 'AND' && $operator != 'OR') {
            throw new \InvalidArgumentException('not allowed operator: "'.$operator.'" (AND / OR is allowed)');
        }

        $this->byValueOperator = (string) $operator;
    }
895017
public function defineOperator(string $operator, callable $transformer): void
    {
        unset($this->inlineOperators[$operator]);
        $this->operators[$operator] = $transformer;
    }
871226
static function operatorStaticData( $tpl, $operatorName )
    {
        if ( is_array( $tpl->Operators[$operatorName] ) )
        {
            $tpl->loadAndRegisterOperators( $tpl->Operators[$operatorName] );
        }
        $operatorObject =& $tpl->Operators[$operatorName];
        $operatorData = null;
        if ( is_object( $operatorObject ) )
        {
            if ( method_exists( $operatorObject, 'operatorCompiledStaticData' ) )
            {
                $operatorData = $operatorObject->operatorCompiledStaticData( $operatorName );
            }
        }
        else if ( $tpl->testCompile() )
        {
            $tpl->warning( '', "Operator '$operatorName' is not registered." );
        }

        return $operatorData;
    }
1189315
public function getInlineOperator(string $operator): callable
    {
        if (!$this->hasInlineOperator($operator)) {
            throw new OperatorNotFoundException($operator, sprintf('Inline operator "%s" does not exist.', $operator));
        }

        return $this->inlineOperators[$operator];
    }
239688
public function whereNot($name, $operator = "=", $value = NULL)
    {

        if (is_callback_function($name)) {
            $name($this);
            return $this;
        }

        if (!$this->isOperator($operator)) {
            $value = $operator;
            $operator = "=";
        }

        if ($operator == "=") {
            $this->must_not[] = ["term" => [$name => $value]];
        }

        if ($operator == ">") {
            $this->must_not[] = ["range" => [$name => ["gt" => $value]]];
        }

        if ($operator == ">=") {
            $this->must_not[] = ["range" => [$name => ["gte" => $value]]];
        }

        if ($operator == "<") {
            $this->must_not[] = ["range" => [$name => ["lt" => $value]]];
        }

        if ($operator == "<=") {
            $this->must_not[] = ["range" => [$name => ["lte" => $value]]];
        }

        if ($operator == "like") {
            $this->must_not[] = ["match" => [$name => $value]];
        }

        if ($operator == "exists") {
            $this->whereExists($name, !$value);
        }

        return $this;
    }
621856
public static function getIdentifier(string $name, string $separator = '_'): string {
    return self::identifier($name, $separator);
  }
234361
static public function isValid($operator, $throwException = false)
    {
        $operator = intval($operator);
        if ($operator > 0 && $operator <= static::IS_NOT_NULL) {
            return true;
        }

        if ($throwException) {
            throw new InvalidArgumentException('Unexpected filter operator.');
        }

        return false;
    }
647595
final protected static function validateOperator (string $operator, string $defaultOperator="=") : string
	{
		return static::isOperatorValid($operator) ? $operator : ($defaultOperator ?: '=');
	}
668724
private function _prepareUnaryExpression($operator, $child) {
        return $this->_iterName.$operator.self::OPEN_BRAKET.$child.self::CLOSE_BRACKET;
    }
1174611
public static function validate(string $operator)
    {
        if (!isset(self::$operators[$operator])) {
            throw InvalidArgumentException::format(
                'Invalid condition operator: expecting one of (%s), \'%s\' given',
                Debug::formatValues(array_keys(self::$operators)), $operator
            );
        }
    }
118969
private static function validateName(string $name) : string
  {
    if (empty($name) || preg_match("/[=,; \t\r\n\013\014]/", $name)) {
      throw new \InvalidArgumentException(sprintf('Invalid name \'%s\'.', $name));
    }

    return $name;
  }
572279
public function validateOperator($operator)
    {
        $operators = Operator::get();

        if (in_array($operator, $operators)) return true;

        $message = "Operator: $operator is invalid, and cannot be used.";

        throw new InvalidOperatorException($message);
    }
94889
public function setOperator($operator)
    {
        if ($operator) {
            if (!$this->validateOperator($operator)) {
                throw new \InvalidArgumentException(\sprintf('Binding invalid operator "%s" into filter "%s"', $operator, $this->name));
            }
            $this->operator = $operator;
            $this->updateBound();
        }

        return $this;
    }
976303
protected function getManipulatorClass(string $name): string
    {
        if (!isset($this->manipulatorMap[$name])) {
            throw new Exception("Unknown manipulator name: {$name}.");
        }

        return $this->manipulatorMap[$name];
    }