function FieldWidgetConstraintValidator::validate

Same name in other branches
  1. 9 core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/FieldWidgetConstraintValidator.php \Drupal\entity_test\Plugin\Validation\Constraint\FieldWidgetConstraintValidator::validate()
  2. 8.9.x core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/FieldWidgetConstraintValidator.php \Drupal\entity_test\Plugin\Validation\Constraint\FieldWidgetConstraintValidator::validate()
  3. 10 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 18

Class

FieldWidgetConstraintValidator
Validates the FieldWidgetConstraint constraint.

Namespace

Drupal\entity_test\Plugin\Validation\Constraint

Code

public function validate($field_item, Constraint $constraint) : void {
    $this->context
        ->addViolation($constraint->message);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.