You are here

public function PurgersService::getPluginsAvailable in Purge 8.3

This method takes into account that purger plugins that are not multi-instantiable, can only be loaded once and are no longer available if they are already available. Plugins that are multi-instantiable, will always be listed.

Overrides ModifiableServiceInterface::getPluginsAvailable

File

src/Plugin/Purge/Purger/PurgersService.php, line 271

Class

PurgersService
Provides the service that distributes access to one or more purgers.

Namespace

Drupal\purge\Plugin\Purge\Purger

Code

public function getPluginsAvailable() {
  $enabled = $this
    ->getPluginsEnabled();
  $available = [];
  foreach ($this
    ->getPlugins() as $plugin_id => $definition) {
    if ($definition['multi_instance']) {
      $available[] = $plugin_id;
    }
    else {
      if (!in_array($plugin_id, $enabled)) {
        $available[] = $plugin_id;
      }
    }
  }
  return $available;
}