function ExecutionContext::addViolation
Same name in other branches
- 9 core/lib/Drupal/Core/TypedData/Validation/ExecutionContext.php \Drupal\Core\TypedData\Validation\ExecutionContext::addViolation()
- 8.9.x core/lib/Drupal/Core/TypedData/Validation/ExecutionContext.php \Drupal\Core\TypedData\Validation\ExecutionContext::addViolation()
- 11.x core/lib/Drupal/Core/Validation/ExecutionContext.php \Drupal\Core\Validation\ExecutionContext::addViolation()
phpcs:ignore Drupal.Commenting.FunctionComment.VoidReturn
Return value
void
File
-
core/
lib/ Drupal/ Core/ Validation/ ExecutionContext.php, line 118
Class
- ExecutionContext
- Defines an execution context class.
Namespace
Drupal\Core\ValidationCode
public function addViolation(string $message, array $params = []) {
$this->violations
->add(new ConstraintViolation($this->translator
->trans($message, $params, $this->translationDomain), $message, $params, $this->root, $this->propertyPath, $this->value, NULL, NULL, $this->constraint));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.