function ExecutionContext::addViolation
Same name in this branch
- 11.1.x vendor/symfony/validator/Context/ExecutionContext.php \Symfony\Component\Validator\Context\ExecutionContext::addViolation()
Overrides ExecutionContextInterface::addViolation
File
-
core/
lib/ Drupal/ Core/ Validation/ ExecutionContext.php, line 114
Class
- ExecutionContext
- Defines an execution context class.
Namespace
Drupal\Core\ValidationCode
public function addViolation(string $message, array $params = []) : void {
$this->violations
->add(new ConstraintViolation($this->translator
->trans($message, $params, $this->translationDomain), $message, $params, $this->root, $this->propertyPath, $this->value, NULL, NULL, $this->constraint));
}