1. 8.3.x vendor/symfony/validator/Constraint.php
  2. 8.3.x core/lib/Drupal/Core/Validation/Annotation/Constraint.php
  3. 8.3.x vendor/composer/semver/src/Constraint/Constraint.php
  4. 8.0.x core/lib/Drupal/Core/Validation/Annotation/Constraint.php
  5. 8.0.x vendor/composer/semver/src/Constraint/Constraint.php
  6. 8.0.x vendor/symfony/validator/Constraint.php
  7. 8.0.x vendor/phpunit/phpunit/src/Framework/Constraint.php
  8. 8.1.x core/lib/Drupal/Core/Validation/Annotation/Constraint.php
  9. 8.1.x vendor/symfony/validator/Constraint.php
  10. 8.1.x vendor/composer/semver/src/Constraint/Constraint.php
  11. 8.2.x vendor/composer/semver/src/Constraint/Constraint.php
  12. 8.2.x vendor/symfony/validator/Constraint.php
  13. 8.2.x core/lib/Drupal/Core/Validation/Annotation/Constraint.php
  14. 8.4.x core/lib/Drupal/Core/Validation/Annotation/Constraint.php
  15. 8.4.x vendor/symfony/validator/Constraint.php
  16. 8.4.x vendor/composer/semver/src/Constraint/Constraint.php

Namespace

Drupal\Core\Validation\Annotation

File

core/lib/Drupal/Core/Validation/Annotation/Constraint.php
View source
  1. <?php
  2. namespace Drupal\Core\Validation\Annotation;
  3. use Drupal\Component\Annotation\Plugin;
  4. /**
  5. * Defines a validation constraint annotation object.
  6. *
  7. * Plugin Namespace: Plugin\Validation\Constraint
  8. *
  9. * For a working example, see
  10. * \Drupal\Core\Validation\Plugin\Validation\Constraint\LengthConstraint
  11. *
  12. * @see \Drupal\Core\Validation\ConstraintManager
  13. * @see \Symfony\Component\Validator\Constraint
  14. * @see hook_validation_constraint_alter()
  15. * @see plugin_api
  16. *
  17. * @Annotation
  18. */
  19. class Constraint extends Plugin {
  20. /**
  21. * The constraint plugin ID.
  22. *
  23. * @var string
  24. */
  25. public $id;
  26. /**
  27. * The human-readable name of the constraint plugin.
  28. *
  29. * @ingroup plugin_translatable
  30. *
  31. * @var string|\Drupal\Core\Annotation\Translation
  32. */
  33. public $label;
  34. /**
  35. * An array of DataType plugin IDs for which this constraint applies. Valid
  36. * values are any types registered by the typed data API, or an array of
  37. * multiple type names. For supporting all types, FALSE may be specified. The
  38. * key defaults to an empty array, which indicates no types are supported.
  39. *
  40. * @var string|string[]|false
  41. *
  42. * @see \Drupal\Core\TypedData\Annotation\DataType
  43. */
  44. public $type = [];
  45. }

Classes

Namesort descending Description
Constraint Defines a validation constraint annotation object.