forked from bartfeenstra/drupal-currency
-
Notifications
You must be signed in to change notification settings - Fork 0
/
currency.api.php
33 lines (28 loc) · 945 Bytes
/
currency.api.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
* @file Contains Currency hook documentation.
*/
/**
* Alters currency exchange rate provider plugins.
*
* @param array[] $definitions
* Keys are plugin IDs. Values are plugin definitions.
*/
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';
}
/**
* Alters currency amount formatter plugins.
*
* @param array[] $definitions
* Keys are plugin IDs. Values are plugin definitions.
*/
function hook_currency_amount_formatter_alter(array &$definitions) {
// Remove an amount formatter plugin.
unset($definitions['foo_plugin_id']);
// Replace an amount formatter plugin with another.
$definitions['foo_plugin_id']['class'] = 'Drupal\foo\FooAmountFormatter';
}