You are here

FieldWidgetConstraintValidator.php in Drupal 10

File

core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/FieldWidgetConstraintValidator.php
View source
<?php

namespace Drupal\entity_test\Plugin\Validation\Constraint;

use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;

/**
 * Validates the FieldWidgetConstraint constraint.
 */
class FieldWidgetConstraintValidator extends ConstraintValidator {

  /**
   * {@inheritdoc}
   */
  public function validate($field_item, Constraint $constraint) {
    $this->context
      ->addViolation($constraint->message);
  }

}

Classes

Namesort descending Description
FieldWidgetConstraintValidator Validates the FieldWidgetConstraint constraint.