public function isValid($condition)
    {
        $conditionTree = ConditionParser::get()
            ->parse($condition);

        if (true === $conditionTree->getValidationResult()->hasErrors()) {
            $errorMessage = $this->translateErrorMessage(
                'validator.form.condition_is_valid.error',
                'formz',
                [
                    $condition->getExpression(),
                    $conditionTree->getValidationResult()->getFirstError()->getMessage()
                ]
            );

            $this->addError($errorMessage, self::ERROR_CODE);
        }
    }
public function isValid($condition)
    {
        $conditionTree = ConditionParser::get()
            ->parse($condition);

        if (true === $conditionTree->getValidationResult()->hasErrors()) {
            $errorMessage = $this->translateErrorMessage(
                'validator.form.condition_is_valid.error',
                'formz',
                [
                    $condition->getExpression(),
                    $conditionTree->getValidationResult()->getFirstError()->getMessage()
                ]
            );

            $this->addError($errorMessage, self::ERROR_CODE);
        }
    }
public function isValid ( $ condition ) { $ conditionTree = ConditionParser :: get ( ) -> parse ( $ condition ) ; if ( true === $ conditionTree -> getValidationResult ( ) -> hasErrors ( ) ) { $ errorMessage = $ this -> translateErrorMessage ( 'validator.form.condition_is_valid.error' , 'formz' , [ $ condition -> getExpression ( ) , $ conditionTree -> getValidationResult ( ) -> getFirstError ( ) -> getMessage ( ) ] ) ; $ this -> addError ( $ errorMessage , self :: ERROR_CODE ) ; } }
Checks if the value is a valid condition string.

@param ActivationInterface $condition The condition instance that should be validated.
Checks if the value is a valid condition string .