You are here

function hook_currency_exchange_rate_provider_alter in Currency 8.3

Alters currency exchange rate provider plugins.

Parameters

array[] $definitions: Keys are plugin IDs. Values are plugin definitions.

1 invocation of hook_currency_exchange_rate_provider_alter()
ExchangeRateProviderManager::__construct in src/Plugin/Currency/ExchangeRateProvider/ExchangeRateProviderManager.php
Constructs a new instance.

File

./currency.api.php, line 13
Contains Currency hook documentation.

Code

function hook_currency_exchange_rate_provider_alter(array &$definitions) {

  // Remove an exchange rate provider plugin.
  unset($definitions['foo_plugin_id']);

  // Replace an exchange rate provider plugin with another.
  $definitions['foo_plugin_id']['class'] = 'Drupal\\foo\\FooExchangeRateProvider';
}