public function FieldWidgetConstraintValidator::validate in Drupal 9
Same name and namespace in other branches
- 8 core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/FieldWidgetConstraintValidator.php \Drupal\entity_test\Plugin\Validation\Constraint\FieldWidgetConstraintValidator::validate()
File
- core/
modules/ system/ tests/ modules/ entity_test/ src/ Plugin/ Validation/ Constraint/ FieldWidgetConstraintValidator.php, line 16
Class
- FieldWidgetConstraintValidator
- Validates the FieldWidgetConstraint constraint.
Namespace
Drupal\entity_test\Plugin\Validation\ConstraintCode
public function validate($field_item, Constraint $constraint) {
$this->context
->addViolation($constraint->message);
}