9524858807c0e1d46c900c0861d82001ce36c14e
[yaffs-website] / src / Annotation / BootstrapSetting.php
1 <?php
2 /**
3  * @file
4  * Contains \Drupal\bootstrap\Annotation\BootstrapSetting.
5  */
6
7 namespace Drupal\bootstrap\Annotation;
8
9 use Doctrine\Common\Annotations\Annotation\Attribute;
10 use Doctrine\Common\Annotations\Annotation\Attributes;
11 use Drupal\Component\Annotation\Plugin;
12
13 /**
14  * Defines a BootstrapSetting annotation object.
15  *
16  * Plugin Namespace: "Plugin/Setting".
17  *
18  * @see \Drupal\bootstrap\Plugin\SettingInterface
19  * @see \Drupal\bootstrap\Plugin\SettingManager
20  * @see plugin_api
21  *
22  * @Annotation
23  *
24  * @Attributes({
25  *
26  * @Attribute("defaultValue", type = "mixed", required = true),
27  *
28  * @Attribute("type", type = "string", required = true),
29  * })
30  *
31  * @ingroup plugins_setting
32  */
33 class BootstrapSetting extends Plugin {
34
35   /**
36    * The setting's description.
37    *
38    * @var \Drupal\Core\Annotation\Translation
39    */
40   public $description;
41
42   /**
43    * The setting's default value.
44    *
45    * @var mixed
46    */
47   public $defaultValue;
48
49   /**
50    * The setting's groups.
51    *
52    * @var \Drupal\Core\Annotation\Translation[]
53    */
54   public $groups = [];
55
56   /**
57    * The setting's title.
58    *
59    * @var \Drupal\Core\Annotation\Translation
60    */
61   public $title;
62
63   /**
64    * The setting's type.
65    *
66    * @var string
67    */
68   public $type;
69
70   /**
71    * The setting's see references.
72    *
73    * @var array
74    */
75   public $see = [];
76
77   /**
78    * {@inheritdoc}
79    */
80   public function __construct($values) {
81     if (!isset($values['groups'])) {
82       $values['groups'] = ['general' => t('General')];
83     }
84     parent::__construct($values);
85   }
86
87 }