You are here

public function PluginBasedExchangeRateProvider::loadConfiguration in Currency 8.3

Loads the plugin configuration.

Return value

bool[] Keys are currency_exchanger plugin names. Values are booleans that describe whether the plugins are enabled. Items are ordered by weight.

1 call to PluginBasedExchangeRateProvider::loadConfiguration()
PluginBasedExchangeRateProvider::getExchangeRateProviders in src/PluginBasedExchangeRateProvider.php

File

src/PluginBasedExchangeRateProvider.php, line 46

Class

PluginBasedExchangeRateProvider
Provides currency exchange rates through plugins.

Namespace

Drupal\currency

Code

public function loadConfiguration() {
  $definitions = $this->currencyExchangeRateProviderManager
    ->getDefinitions();
  $configuration_data = $this->configFactory
    ->get('currency.exchange_rate_provider')
    ->get('plugins');
  $configuration = array();
  foreach ($configuration_data as $data) {
    $configuration[$data['plugin_id']] = $data['status'];
  }
  return $configuration + array_fill_keys(array_keys($definitions), FALSE);
}