interface RemovableDependentPluginInterface

Provides an interface for plugins that react when dependencies are removed.

Hierarchy

Expanded class hierarchy of RemovableDependentPluginInterface

All classes that implement RemovableDependentPluginInterface

Related topics

4 files declare their use of RemovableDependentPluginInterface
ConfigEntityBase.php in core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
ImageEffectInterface.php in core/modules/image/src/ImageEffectInterface.php
MediaEmbed.php in core/modules/media/src/Plugin/Filter/MediaEmbed.php
TestConfigurablePlugin.php in core/tests/Drupal/Tests/Core/Plugin/Fixtures/TestConfigurablePlugin.php

File

core/lib/Drupal/Core/Plugin/RemovableDependentPluginInterface.php, line 14

Namespace

Drupal\Core\Plugin
View source
interface RemovableDependentPluginInterface extends DependentPluginInterface {
  
  /**
   * Informs the plugin in a collection to act on removal of dependencies.
   *
   * This method allows a plugin instance in a collection to remove dependencies
   * from their configuration. For example, if a plugin integrates with a
   * specific module, it should remove that module from its own configuration
   * when the module is uninstalled.
   *
   * @param array<string, list<string>> $dependencies
   *   An array of dependencies that will be deleted keyed by dependency type.
   *   Dependency types are, for example, entity, module and theme.
   *
   * @return \Drupal\Core\Plugin\RemovableDependentPluginReturn
   *   - RemovableDependentPluginReturn::Changed if the configuration of the
   *     plugin instance has changed
   *   - RemovableDependentPluginReturn::Remove if the plugin instance should be
   *     removed from the plugin collection
   *   - RemovableDependentPluginReturn::Unchanged if the configuration of the
   *     plugin instance has not changed.
   */
  public function onCollectionDependencyRemoval(array $dependencies) : RemovableDependentPluginReturn;

}

Members

Title Sort descending Modifiers Object type Summary Overrides
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 19
RemovableDependentPluginInterface::onCollectionDependencyRemoval public function Informs the plugin in a collection to act on removal of dependencies. 3

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.