interface PluginSettingsInterface

Interface definition for plugin with settings.

Hierarchy

Expanded class hierarchy of PluginSettingsInterface

All classes that implement PluginSettingsInterface

3 files declare their use of PluginSettingsInterface
FormatterInterface.php in drupal/core/modules/field/lib/Drupal/field/Plugin/Type/Formatter/FormatterInterface.php
Definition of Drupal\field\Plugin\Type\Formatter\FormatterInterface.
PluginSettingsBase.php in drupal/core/modules/field/lib/Drupal/field/Plugin/PluginSettingsBase.php
Definition of Drupal\field\Plugin\PluginSettingsBase.
WidgetBaseInterface.php in drupal/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetBaseInterface.php
Definition of Drupal\field\Plugin\Type\Widget\WidgetBaseInterface.

File

drupal/core/modules/field/lib/Drupal/field/Plugin/PluginSettingsInterface.php, line 15
Definition of Drupal\field\Plugin\PluginSettingsInterface.

Namespace

Drupal\field\Plugin
View source
interface PluginSettingsInterface extends PluginInspectionInterface {

  /**
   * Returns the array of settings, including defaults for missing settings.
   *
   * @return array
   *   The array of settings.
   */
  public function getSettings();

  /**
   * Returns the value of a setting, or its default value if absent.
   *
   * @param string $key
   *   The setting name.
   *
   * @return mixed
   *   The setting value.
   */
  public function getSetting($key);

  /**
   * Returns the default settings for the plugin.
   *
   * @return array
   *   The array of default setting values, keyed by setting names.
   */
  public function getDefaultSettings();

  /**
   * Sets the settings for the plugin.
   *
   * @param array $settings
   *   The array of settings, keyed by setting names. Missing settings will be
   *   assigned their default values.
   *
   * @return Drupal\field\Plugin\PluginSettingsInterface
   *   The plugin itself.
   */
  public function setSettings(array $settings);

  /**
   * Sets the value of a setting for the plugin.
   *
   * @param string $key
   *   The setting name.
   * @param mixed $value
   *   The setting value.
   *
   * @return Drupal\field\Plugin\PluginSettingsInterface
   *   The plugin itself.
   */
  public function setSetting($key, $value);

}

Members

Namesort descending Modifiers Type Description Overrides
PluginInspectionInterface::getDefinition public function Returns the definition of the plugin implementation. 1
PluginInspectionInterface::getPluginId public function Returns the plugin_id of the plugin instance. 1
PluginSettingsInterface::getDefaultSettings public function Returns the default settings for the plugin. 1
PluginSettingsInterface::getSetting public function Returns the value of a setting, or its default value if absent. 1
PluginSettingsInterface::getSettings public function Returns the array of settings, including defaults for missing settings. 1
PluginSettingsInterface::setSetting public function Sets the value of a setting for the plugin. 1
PluginSettingsInterface::setSettings public function Sets the settings for the plugin. 1