You are here

public function ProviderPluginManager::getPlugins in Geocoder 8.2

Same name and namespace in other branches
  1. 8.3 src/ProviderPluginManager.php \Drupal\geocoder\ProviderPluginManager::getPlugins()

Return the array of plugins and their settings if any.

Return value

array A list of plugins with their settings.

Overrides GeocoderPluginManagerBase::getPlugins

1 call to ProviderPluginManager::getPlugins()
ProviderPluginManager::providersPluginsTableList in src/ProviderPluginManager.php
Generates the Draggable Table of Selectable Geocoder Plugins.

File

src/ProviderPluginManager.php, line 88

Class

ProviderPluginManager
Provides a plugin manager for geocoder providers.

Namespace

Drupal\geocoder

Code

public function getPlugins() {
  $plugins_arguments = (array) $this->config
    ->get('plugins_options');
  $definitions = array_map(function (array $definition) use ($plugins_arguments) {
    $plugins_arguments += [
      $definition['id'] => [],
    ];
    $definition += [
      'name' => $definition['id'],
      'arguments' => [],
    ];
    $definition['arguments'] = array_merge((array) $definition['arguments'], (array) $plugins_arguments[$definition['id']]);
    return $definition;
  }, $this
    ->getDefinitions());
  ksort($definitions);
  return $definitions;
}