diff core/modules/views/src/Plugin/DependentWithRemovalPluginInterface.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/modules/views/src/Plugin/DependentWithRemovalPluginInterface.php	Wed Nov 29 16:09:58 2017 +0000
@@ -0,0 +1,31 @@
+<?php
+
+namespace Drupal\views\Plugin;
+
+/**
+ * Provides an interface for a plugin that has dependencies that can be removed.
+ *
+ * @ingroup views_plugins
+ */
+interface DependentWithRemovalPluginInterface {
+
+  /**
+   * Allows a plugin to define whether it should be removed.
+   *
+   * If this method returns TRUE then the plugin should be removed.
+   *
+   * @param array $dependencies
+   *   An array of dependencies that will be deleted keyed by dependency type.
+   *   Dependency types are, for example, entity, module and theme.
+   *
+   * @return bool
+   *   TRUE if the plugin instance should be removed.
+   *
+   * @see \Drupal\Core\Config\Entity\ConfigDependencyManager
+   * @see \Drupal\Core\Config\ConfigEntityBase::preDelete()
+   * @see \Drupal\Core\Config\ConfigManager::uninstall()
+   * @see \Drupal\Core\Entity\EntityDisplayBase::onDependencyRemoval()
+   */
+  public function onDependencyRemoval(array $dependencies);
+
+}