public function validate($value, Constraint $constraint)
    {
        /** @var SetType $constraint */
        if (!$constraint->class) {
            throw new ConstraintDefinitionException('Target is not specified');
        }

        /** @var string $class class name of inheriting \Okapon\DoctrineSetTypeBundle\DBAL\Types\AbstractSetType */
        $class = $constraint->class;
        if (!class_exists($class)) {
            throw new TargetClassNotExistException('Target class not exist.');
        }

        $constraint->choices = $class::getValues();
        $constraint->multiple =true;

        parent::validate($value, $constraint);
    }
public function validate($value, Constraint $constraint)
    {
        /** @var SetType $constraint */
        if (!$constraint->class) {
            throw new ConstraintDefinitionException('Target is not specified');
        }

        /** @var string $class class name of inheriting \Okapon\DoctrineSetTypeBundle\DBAL\Types\AbstractSetType */
        $class = $constraint->class;
        if (!class_exists($class)) {
            throw new TargetClassNotExistException('Target class not exist.');
        }

        $constraint->choices = $class::getValues();
        $constraint->multiple =true;

        parent::validate($value, $constraint);
    }
public function validate ( $ value , Constraint $ constraint ) { /** @var SetType $constraint */ if ( ! $ constraint -> class ) { throw new ConstraintDefinitionException ( 'Target is not specified' ) ; } /** @var string $class class name of inheriting \Okapon\DoctrineSetTypeBundle\DBAL\Types\AbstractSetType */ $ class = $ constraint -> class ; if ( ! class_exists ( $ class ) ) { throw new TargetClassNotExistException ( 'Target class not exist.' ) ; } $ constraint -> choices = $ class :: getValues ( ) ; $ constraint -> multiple = true ; parent :: validate ( $ value , $ constraint ) ; }
Checks if the passed value is valid

@param mixed      $value      The value that should be validated
@param Constraint $constraint The constraint for the validation

@throws ConstraintDefinitionException

@return void
Checks if the passed value is valid