4 * Contains \Drupal\bootstrap\Plugin\Setting\SettingInterface.
7 namespace Drupal\bootstrap\Plugin\Setting;
9 use Drupal\bootstrap\Plugin\Form\FormInterface;
10 use Drupal\bootstrap\Utility\Element;
11 use Drupal\Component\Plugin\PluginInspectionInterface;
12 use Drupal\Core\Form\FormStateInterface;
15 * Defines the interface for an object oriented theme setting plugin.
17 * @ingroup plugins_setting
19 interface SettingInterface extends PluginInspectionInterface, FormInterface {
22 * Determines whether a theme setting should added to drupalSettings.
24 * By default, this value will be FALSE unless the method is overridden. This
25 * is to ensure that no sensitive information can be potientially leaked.
27 * @see \Drupal\bootstrap\Plugin\Setting\SettingBase::drupalSettings()
32 public function drupalSettings();
35 * The cache tags associated with this object.
37 * When this object is modified, these cache tags will be invalidated.
40 * A set of cache tags.
42 public function getCacheTags();
45 * Retrieves the setting's default value.
48 * The setting's default value.
50 public function getDefaultValue();
53 * Retrieves the group form element the setting belongs to.
56 * Nested array of form elements that comprise the form.
57 * @param \Drupal\Core\Form\FormStateInterface $form_state
58 * The current state of the form.
60 * @return \Drupal\bootstrap\Utility\Element
61 * The group element object.
63 * @deprecated Will be removed in a future release. Use \Drupal\bootstrap\Plugin\Setting\SettingInterface::getGroupElement
65 public function getGroup(array &$form, FormStateInterface $form_state);
68 * Retrieves the group form element the setting belongs to.
70 * @param \Drupal\bootstrap\Utility\Element $form
71 * The Element object that comprises the form.
72 * @param \Drupal\Core\Form\FormStateInterface $form_state
73 * The current state of the form.
75 * @return \Drupal\bootstrap\Utility\Element
76 * The group element object.
78 public function getGroupElement(Element $form, FormStateInterface $form_state);
81 * Retrieves the setting's groups.
84 * The setting's group.
86 public function getGroups();
89 * Retrieves the form element for the setting.
92 * Nested array of form elements that comprise the form.
93 * @param \Drupal\Core\Form\FormStateInterface $form_state
94 * The current state of the form.
96 * @return \Drupal\bootstrap\Utility\Element
97 * The setting element object.
99 * @deprecated Will be removed in a future release. Use \Drupal\bootstrap\Plugin\Setting\SettingInterface::getSettingElement
101 public function getElement(array &$form, FormStateInterface $form_state);
104 * Retrieves the settings options, if set.
107 * An array of options.
109 public function getOptions();
112 * Retrieves the form element for the setting.
114 * @param \Drupal\bootstrap\Utility\Element $form
115 * The Element object that comprises the form.
116 * @param \Drupal\Core\Form\FormStateInterface $form_state
117 * The current state of the form.
119 * @return \Drupal\bootstrap\Utility\Element
120 * The setting element object.
122 public function getSettingElement(Element $form, FormStateInterface $form_state);
125 * Retrieves the setting's human-readable title.
128 * The setting's type.
130 public function getTitle();