Pull merge.
[yaffs-website] / web / core / lib / Drupal / Core / Validation / Annotation / Constraint.php
1 <?php
2
3 namespace Drupal\Core\Validation\Annotation;
4
5 use Drupal\Component\Annotation\Plugin;
6
7 /**
8  * Defines a validation constraint annotation object.
9  *
10  * Plugin Namespace: Plugin\Validation\Constraint
11  *
12  * For a working example, see
13  * \Drupal\Core\Validation\Plugin\Validation\Constraint\LengthConstraint
14  *
15  * @see \Drupal\Core\Validation\ConstraintManager
16  * @see \Symfony\Component\Validator\Constraint
17  * @see hook_validation_constraint_alter()
18  * @see plugin_api
19  *
20  * @Annotation
21  */
22 class Constraint extends Plugin {
23
24   /**
25    * The constraint plugin ID.
26    *
27    * @var string
28    */
29   public $id;
30
31   /**
32    * The human-readable name of the constraint plugin.
33    *
34    * @ingroup plugin_translatable
35    *
36    * @var string|\Drupal\Core\Annotation\Translation
37    */
38   public $label;
39
40   /**
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.
45    *
46    * @var string|string[]|false
47    *
48    * @see \Drupal\Core\TypedData\Annotation\DataType
49    */
50   public $type = [];
51
52 }