You are here

public function TestSuggester::onDependencyRemoval in Search API Autocomplete 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_autocomplete_test/src/Plugin/search_api_autocomplete/suggester/TestSuggester.php, line 118

Class

TestSuggester
Defines a test suggester class.

Namespace

Drupal\search_api_autocomplete_test\Plugin\search_api_autocomplete\suggester

Code

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