Exemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function validate($value, Constraint $constraint)
 {
     $callback = $constraint->getFilterCallback();
     $entity = $constraint->getMapper()->findBy($callback($value));
     if ($entity instanceof AbstractEntity) {
         return;
     }
     $this->context->addViolation($constraint->message, ['{{ field }}' => $constraint->field, '{{ value }}' => $value], $value);
 }