| @@ 17-26 (lines=10) @@ | ||
| 14 | * @inheritDoc |
|
| 15 | * @param ExistingParameter $constraint |
|
| 16 | */ |
|
| 17 | public function validate($value, Constraint $constraint) |
|
| 18 | { |
|
| 19 | if (!Registry::getInstance()->find($value)) { |
|
| 20 | $this |
|
| 21 | ->context |
|
| 22 | ->buildViolation($constraint->message) |
|
| 23 | ->setParameter('{{ name }}', $value) |
|
| 24 | ->addViolation(); |
|
| 25 | } |
|
| 26 | } |
|
| 27 | } |
|
| 28 | ||
| @@ 17-26 (lines=10) @@ | ||
| 14 | * @inheritDoc |
|
| 15 | * @param ExistingType $constraint |
|
| 16 | */ |
|
| 17 | public function validate($value, Constraint $constraint) |
|
| 18 | { |
|
| 19 | if (!Registry::getInstance()->find($value)) { |
|
| 20 | $this |
|
| 21 | ->context |
|
| 22 | ->buildViolation($constraint->message) |
|
| 23 | ->setParameter('{{ name }}', $value) |
|
| 24 | ->addViolation(); |
|
| 25 | } |
|
| 26 | } |
|
| 27 | ||
| 28 | } |
|
| 29 | ||