3 namespace Drupal\Core\Validation\Annotation;
5 use Drupal\Component\Annotation\Plugin;
8 * Defines a validation constraint annotation object.
10 * Plugin Namespace: Plugin\Validation\Constraint
12 * For a working example, see
13 * \Drupal\Core\Validation\Plugin\Validation\Constraint\LengthConstraint
15 * @see \Drupal\Core\Validation\ConstraintManager
16 * @see \Symfony\Component\Validator\Constraint
17 * @see hook_validation_constraint_alter()
22 class Constraint extends Plugin {
25 * The constraint plugin ID.
32 * The human-readable name of the constraint plugin.
34 * @ingroup plugin_translatable
36 * @var string|\Drupal\Core\Annotation\Translation
41 * An array of DataType plugin IDs for which this constraint applies. Valid
42 * values are any types registered by the typed data API, or an array of
43 * multiple type names. For supporting all types, FALSE may be specified. The
44 * key defaults to an empty array, which indicates no types are supported.
46 * @var string|string[]|false
48 * @see \Drupal\Core\TypedData\Annotation\DataType