class FieldWidgetConstraintValidator

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
  2. 8.9.x core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/FieldWidgetConstraintValidator.php \Drupal\entity_test\Plugin\Validation\Constraint\FieldWidgetConstraintValidator
  3. 11.x core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/FieldWidgetConstraintValidator.php \Drupal\entity_test\Plugin\Validation\Constraint\FieldWidgetConstraintValidator

Validates the FieldWidgetConstraint constraint.

Hierarchy

Expanded class hierarchy of FieldWidgetConstraintValidator

File

core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/FieldWidgetConstraintValidator.php, line 11

Namespace

Drupal\entity_test\Plugin\Validation\Constraint
View source
class FieldWidgetConstraintValidator extends ConstraintValidator {
    
    /**
     * {@inheritdoc}
     */
    public function validate($field_item, Constraint $constraint) {
        $this->context
            ->addViolation($constraint->message);
    }

}

Members

Title Sort descending Modifiers Object type Summary
FieldWidgetConstraintValidator::validate public function

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