/** * {@inheritDoc} */ public function validate($value, Constraint $constraint) { if ($constraint->isAlreadyRegistered($value)) { $this->context->addViolation($constraint->message); } }