You are here

class TestFieldConstraint in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/field/tests/modules/field_test/src/Plugin/Validation/Constraint/TestFieldConstraint.php \Drupal\field_test\Plugin\Validation\Constraint\TestFieldConstraint
  2. 9 core/modules/field/tests/modules/field_test/src/Plugin/Validation/Constraint/TestFieldConstraint.php \Drupal\field_test\Plugin\Validation\Constraint\TestFieldConstraint

Checks if a value is not equal.

Plugin annotation


@Constraint(
  id = "TestField",
  label = @Translation("Test Field", context = "Validation"),
  type = { "integer" }
)

Hierarchy

  • class \Drupal\field_test\Plugin\Validation\Constraint\TestFieldConstraint extends \Symfony\Component\Validator\Constraints\NotEqualTo

Expanded class hierarchy of TestFieldConstraint

File

core/modules/field/tests/modules/field_test/src/Plugin/Validation/Constraint/TestFieldConstraint.php, line 16

Namespace

Drupal\field_test\Plugin\Validation\Constraint
View source
class TestFieldConstraint extends NotEqualTo {

  /**
   * {@inheritdoc}
   */
  public function getRequiredOptions() {
    return [
      'value',
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function validatedBy() {
    return '\\Symfony\\Component\\Validator\\Constraints\\NotEqualToValidator';
  }

}

Members