You are here

public function ImageEffectsPluginManager::getAvailablePlugins in Image Effects 8.2

Same name and namespace in other branches
  1. 8.3 src/Plugin/ImageEffectsPluginManager.php \Drupal\image_effects\Plugin\ImageEffectsPluginManager::getAvailablePlugins()
  2. 8 src/Plugin/ImageEffectsPluginManager.php \Drupal\image_effects\Plugin\ImageEffectsPluginManager::getAvailablePlugins()

Gets a list of available plugins.

Return value

array An array with the plugin ids as keys and the definitions as values.

2 calls to ImageEffectsPluginManager::getAvailablePlugins()
ImageEffectsPluginManager::getPlugin in src/Plugin/ImageEffectsPluginManager.php
Returns an instance of the specified 'image_effects' plugin.
ImageEffectsPluginManager::getPluginOptions in src/Plugin/ImageEffectsPluginManager.php
Gets a formatted list of available plugins.

File

src/Plugin/ImageEffectsPluginManager.php, line 88

Class

ImageEffectsPluginManager
Plugin manager for image_effects plugins.

Namespace

Drupal\image_effects\Plugin

Code

public function getAvailablePlugins() {
  $plugins = $this
    ->getDefinitions();
  $output = [];
  foreach ($plugins as $id => $definition) {

    // Only allow plugins that are available.
    if (call_user_func($definition['class'] . '::isAvailable')) {
      $output[$id] = $definition;
    }
  }
  return $output;
}