You are here

protected function FilterUninstallValidator::getFilterDefinitionsByProvider in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/filter/src/FilterUninstallValidator.php \Drupal\filter\FilterUninstallValidator::getFilterDefinitionsByProvider()

Returns all filter definitions that are provided by the specified provider.

Parameters

string $provider: The provider of the filters.

Return value

array The filter definitions for the specified provider.

1 call to FilterUninstallValidator::getFilterDefinitionsByProvider()
FilterUninstallValidator::validate in core/modules/filter/src/FilterUninstallValidator.php
Determines the reasons a module can not be uninstalled.

File

core/modules/filter/src/FilterUninstallValidator.php, line 82

Class

FilterUninstallValidator
Prevents uninstallation of modules providing used filter plugins.

Namespace

Drupal\filter

Code

protected function getFilterDefinitionsByProvider($provider) {
  return array_filter($this->filterManager
    ->getDefinitions(), function ($definition) use ($provider) {
    return $definition['provider'] == $provider;
  });
}