You are here

public function TestBackend::onDependencyRemoval in Search API 8

Informs the plugin that some of its dependencies are being removed.

The plugin should attempt to change its configuration in a way to remove its dependency on those items. However, to avoid problems, it should (as far as possible) not add any new dependencies in the process, since there is no guarantee that those are not currently being removed, too.

Parameters

object[][] $dependencies: An array of dependencies, keyed by dependency type ("module", "config", etc.) and dependency name.

Return value

bool Whether the dependency was successfully removed from the plugin – that is, after the configuration changes that were made, none of the removed items are dependencies of this plugin anymore.

Overrides ConfigurablePluginBase::onDependencyRemoval

File

tests/search_api_test/src/Plugin/search_api/backend/TestBackend.php, line 308

Class

TestBackend
Provides a dummy backend for testing purposes.

Namespace

Drupal\search_api_test\Plugin\search_api\backend

Code

public function onDependencyRemoval(array $dependencies) {
  $remove = $this
    ->getReturnValue(__FUNCTION__, FALSE);
  if ($remove) {
    unset($this->configuration['dependencies']);
  }
  return $remove;
}