plus-8.x-4.x-dev/src/Plugin/Setting/SettingInterface.php
src/Plugin/Setting/SettingInterface.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | <?php /** * @file * Contains \Drupal\plus\Plugin\Setting\SettingInterface. */ namespace Drupal\plus\Plugin\Setting; use Drupal\plus\Core\Form\FormAlterInterface; use Drupal\plus\Utility\Element; use Drupal\Component\Plugin\PluginInspectionInterface; use Drupal\Core\Form\FormStateInterface; /** * Defines the interface for an object oriented theme setting plugin. * * @ingroup plugins_setting */ interface SettingInterface extends PluginInspectionInterface, FormAlterInterface { /** * Retrieves the form element for the setting. * * @param \Drupal\plus\Utility\Element $form * The Element object that comprises the form. * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. * * @return \Drupal\plus\Utility\Element * The setting element object. */ public function buildElement(Element $form , FormStateInterface $form_state ); /** * Retrieves the group form element the setting belongs to. * * @param \Drupal\plus\Utility\Element $form * The Element object that comprises the form. * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. * * @return \Drupal\plus\Utility\Element * The group element object. */ public function buildGroup(Element $form , FormStateInterface $form_state ); /** * Determines whether a theme setting should added to drupalSettings. * * By default, this value will be FALSE unless the method is overridden. This * is to ensure that no sensitive information can be potientially leaked. * * @see \Drupal\plus\Plugin\Setting\SettingBase::drupalSettings() * * @return bool * TRUE or FALSE */ public function drupalSettings(); /** * The cache tags associated with this object. * * When this object is modified, these cache tags will be invalidated. * * @return string[] * A set of cache tags. */ public function getCacheTags(); /** * Retrieves the setting's default value. * * @return string * The setting's default value. */ public function getDefaultValue(); /** * Retrieves the setting's groups. * * @return array * The setting's group. */ public function getGroups(); /** * Retrieves the settings options, if set. * * @return array * An array of options. */ public function getOptions(); /** * Retrieves the setting's human-readable title. * * @return string * The setting's type. */ public function getTitle(); } |