You are here

FieldWidgetConstraintValidator.php in Zircon Profile 8.0

File

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

/**
 * @file
 * Contains \Drupal\entity_test\Plugin\Validation\Constraint\FieldWidgetConstraintValidator.
 */
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.