3 namespace Drupal\Core\Field;
5 use Drupal\Component\Plugin\PluginInspectionInterface;
6 use Drupal\Core\Config\Entity\ThirdPartySettingsInterface;
9 * Interface definition for plugin with settings.
11 * @deprecated in Drupal 8.1.0 and will be removed before Drupal 9.0.0. Use
12 * \Drupal\Component\Plugin\ConfigurablePluginInterface instead.
14 interface PluginSettingsInterface extends PluginInspectionInterface, ThirdPartySettingsInterface {
17 * Defines the default settings for this plugin.
20 * A list of default settings, keyed by the setting name.
22 public static function defaultSettings();
25 * Returns the array of settings, including defaults for missing settings.
28 * The array of settings.
30 public function getSettings();
33 * Returns the value of a setting, or its default value if absent.
41 public function getSetting($key);
44 * Sets the settings for the plugin.
46 * @param array $settings
47 * The array of settings, keyed by setting names. Missing settings will be
48 * assigned their default values.
52 public function setSettings(array $settings);
55 * Sets the value of a setting for the plugin.
64 public function setSetting($key, $value);
67 * Informs the plugin that some configuration it depends on will be deleted.
69 * This method allows plugins to keep their configuration up-to-date when a
70 * dependency calculated with ::calculateDependencies() is removed. For
71 * example, an entity view display contains a formatter having a setting
72 * pointing to an arbitrary config entity. When that config entity is deleted,
73 * this method is called by the view display to react to the dependency
74 * removal by updating its configuration.
76 * This method must return TRUE if the removal event updated the plugin
77 * configuration or FALSE otherwise.
79 * @param array $dependencies
80 * An array of dependencies that will be deleted keyed by dependency type.
81 * Dependency types are 'config', 'content', 'module' and 'theme'.
84 * TRUE if the plugin configuration has changed, FALSE if not.
86 * @see \Drupal\Core\Entity\EntityDisplayBase
88 public function onDependencyRemoval(array $dependencies);