protected function ConstraintValidator::buildViolation in Plug 7
Wrapper for {@link ExecutionContextInterface::buildViolation} that supports the 2.4 context API.
Parameters
string $message The violation message:
array $parameters The message parameters:
Return value
ConstraintViolationBuilderInterface The violation builder
Deprecated
This method will be removed in Symfony 3.0.
File
- lib/
Symfony/ validator/ Symfony/ Component/ Validator/ ConstraintValidator.php, line 66
Class
- ConstraintValidator
- Base class for constraint validators.
Namespace
Symfony\Component\ValidatorCode
protected function buildViolation($message, array $parameters = array()) {
if ($this->context instanceof ExecutionContextInterface2Dot5) {
return $this->context
->buildViolation($message, $parameters);
}
return new LegacyConstraintViolationBuilder($this->context, $message, $parameters);
}