You are here

public function SelectionPluginManager::getSelectionGroups in Multi-path autocomplete 8

Returns a list of selection plugins that can provide autocomplete results.

Parameters

string $type: A Multi-path autocomplete type.

Return value

array An array of selection plugins grouped by selection group.

1 call to SelectionPluginManager::getSelectionGroups()
SelectionPluginManager::getInstance in lib/Drupal/mpac/Plugin/Type/SelectionPluginManager.php
Overrides \Drupal\Component\Plugin\PluginManagerBase::getInstance().

File

lib/Drupal/mpac/Plugin/Type/SelectionPluginManager.php, line 71
Contains \Drupal\mpac\Plugin\Type\SelectionPluginManager.

Class

SelectionPluginManager
Plugin type manager for the Multi-path autocomplete Selection plugin.

Namespace

Drupal\mpac\Plugin\Type

Code

public function getSelectionGroups($type) {
  $plugins = array();
  foreach ($this
    ->getDefinitions() as $plugin_id => $plugin) {
    if (!isset($plugin['types']) || in_array($type, $plugin['types'])) {
      $plugins[$plugin_id] = $plugin;
    }
  }
  return $plugins;
}