FieldWidgetConstraintValidator.php in Zircon Profile 8.0
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;
class FieldWidgetConstraintValidator extends ConstraintValidator {
public function validate($field_item, Constraint $constraint) {
$this->context
->addViolation($constraint->message);
}
}