d41626549c8b600daa9a547d660d243e4f4ba078
[yaffs-website] / web / themes / contrib / bootstrap / src / Plugin / Setting / SettingInterface.php
1 <?php
2
3 namespace Drupal\bootstrap\Plugin\Setting;
4
5 use Drupal\bootstrap\Plugin\Form\FormInterface;
6 use Drupal\bootstrap\Utility\Element;
7 use Drupal\Component\Plugin\PluginInspectionInterface;
8 use Drupal\Core\Form\FormStateInterface;
9
10 /**
11  * Defines the interface for an object oriented theme setting plugin.
12  *
13  * @ingroup plugins_setting
14  */
15 interface SettingInterface extends PluginInspectionInterface, FormInterface {
16
17   /**
18    * Determines whether a theme setting should added to drupalSettings.
19    *
20    * By default, this value will be FALSE unless the method is overridden. This
21    * is to ensure that no sensitive information can be potientially leaked.
22    *
23    * @see \Drupal\bootstrap\Plugin\Setting\SettingBase::drupalSettings()
24    *
25    * @return bool
26    *   TRUE or FALSE
27    */
28   public function drupalSettings();
29
30   /**
31    * The cache tags associated with this object.
32    *
33    * When this object is modified, these cache tags will be invalidated.
34    *
35    * @return string[]
36    *   A set of cache tags.
37    */
38   public function getCacheTags();
39
40   /**
41    * Retrieves the setting's default value.
42    *
43    * @return string
44    *   The setting's default value.
45    */
46   public function getDefaultValue();
47
48   /**
49    * Retrieves the group form element the setting belongs to.
50    *
51    * @param array $form
52    *   Nested array of form elements that comprise the form.
53    * @param \Drupal\Core\Form\FormStateInterface $form_state
54    *   The current state of the form.
55    *
56    * @return \Drupal\bootstrap\Utility\Element
57    *   The group element object.
58    *
59    * @deprecated Will be removed in a future release. Use \Drupal\bootstrap\Plugin\Setting\SettingInterface::getGroupElement
60    */
61   public function getGroup(array &$form, FormStateInterface $form_state);
62
63   /**
64    * Retrieves the group form element the setting belongs to.
65    *
66    * @param \Drupal\bootstrap\Utility\Element $form
67    *   The Element object that comprises the form.
68    * @param \Drupal\Core\Form\FormStateInterface $form_state
69    *   The current state of the form.
70    *
71    * @return \Drupal\bootstrap\Utility\Element
72    *   The group element object.
73    */
74   public function getGroupElement(Element $form, FormStateInterface $form_state);
75
76   /**
77    * Retrieves the setting's groups.
78    *
79    * @return array
80    *   The setting's group.
81    */
82   public function getGroups();
83
84   /**
85    * Retrieves the form element for the setting.
86    *
87    * @param array $form
88    *   Nested array of form elements that comprise the form.
89    * @param \Drupal\Core\Form\FormStateInterface $form_state
90    *   The current state of the form.
91    *
92    * @return \Drupal\bootstrap\Utility\Element
93    *   The setting element object.
94    *
95    * @deprecated Will be removed in a future release. Use \Drupal\bootstrap\Plugin\Setting\SettingInterface::getSettingElement
96    */
97   public function getElement(array &$form, FormStateInterface $form_state);
98
99   /**
100    * Retrieves the settings options, if set.
101    *
102    * @return array
103    *   An array of options.
104    */
105   public function getOptions();
106
107   /**
108    * Retrieves the form element for the setting.
109    *
110    * @param \Drupal\bootstrap\Utility\Element $form
111    *   The Element object that comprises the form.
112    * @param \Drupal\Core\Form\FormStateInterface $form_state
113    *   The current state of the form.
114    *
115    * @return \Drupal\bootstrap\Utility\Element
116    *   The setting element object.
117    */
118   public function getSettingElement(Element $form, FormStateInterface $form_state);
119
120   /**
121    * Retrieves the setting's human-readable title.
122    *
123    * @return string
124    *   The setting's type.
125    */
126   public function getTitle();
127
128 }