diff --git a/config/default/currency.currency.AFN.yml b/config/default/currency.currency.AFN.yml index c9648da..bea6f25 100644 --- a/config/default/currency.currency.AFN.yml +++ b/config/default/currency.currency.AFN.yml @@ -4,6 +4,5 @@ currencyNumber: '971' sign: ؋ subunits: 100 label: 'Afghan afghani' -exchangeRates: { } usages: - { start: '2002-10-07', end: '', countryCode: AF } diff --git a/config/default/currency.currency.EUR.yml b/config/default/currency.currency.EUR.yml index 3002daf..838e298 100644 --- a/config/default/currency.currency.EUR.yml +++ b/config/default/currency.currency.EUR.yml @@ -4,7 +4,6 @@ currencyNumber: '978' sign: € subunits: 100 label: euro -exchangeRates: { } usages: - { start: '1999-01-01', end: '', countryCode: AD } - { start: '1999-01-01', end: '', countryCode: AT } diff --git a/config/default/currency.currency.UAH.yml b/config/default/currency.currency.UAH.yml index 632f947..f42a1cf 100644 --- a/config/default/currency.currency.UAH.yml +++ b/config/default/currency.currency.UAH.yml @@ -4,6 +4,5 @@ currencyNumber: '980' sign: ₴ subunits: 100 label: 'Ukrainian hryvnia' -exchangeRates: { } usages: - { start: '1996-09-02', end: '', countryCode: UA } diff --git a/config/default/currency.currency.USD.yml b/config/default/currency.currency.USD.yml index 917d469..d401cc9 100644 --- a/config/default/currency.currency.USD.yml +++ b/config/default/currency.currency.USD.yml @@ -4,7 +4,6 @@ currencyNumber: '840' sign: $ subunits: 100 label: 'U.S. dollar' -exchangeRates: { } usages: - { start: '1904-07-16', end: '', countryCode: AS } - { start: '1899-01-01', end: '1959-01-01', countryCode: CU } diff --git a/config/install/currency.currency.XXX.yml b/config/install/currency.currency.XXX.yml index 2c1a5ee..00b7169 100644 --- a/config/install/currency.currency.XXX.yml +++ b/config/install/currency.currency.XXX.yml @@ -5,7 +5,6 @@ currencyNumber: '999' sign: ¤ subunits: 0 label: 'No currency' -exchangeRates: { } usages: - { start: '', end: '', countryCode: AQ } - { start: '', end: '', countryCode: ZZ } diff --git a/src/Entity/Currency.php b/src/Entity/Currency.php index a6645d0..98d93fd 100644 --- a/src/Entity/Currency.php +++ b/src/Entity/Currency.php @@ -33,7 +33,6 @@ use Drupal\currency\Plugin\Currency\AmountFormatter\AmountFormatterManagerInterf * }, * config_export = { * "alternativeSigns", - * "exchangeRates", * "currencyCode", * "currencyNumber", * "label", @@ -123,13 +122,6 @@ class Currency extends ConfigEntityBase implements CurrencyInterface { protected $subunits; /** - * An array of exchange rates for different currency conversions. - * - * @var array - */ - protected $exchangeRates; - - /** * This currency's usages. * * @var \Drupal\currency\UsageInterface[] @@ -201,21 +193,6 @@ class Currency extends ConfigEntityBase implements CurrencyInterface { /** * {@inheritdoc} */ - public function getExchangeRates() { - return $this->exchangeRates; - } - /** - * {@inheritdoc} - */ - public function setExchangeRates(array $exchange_rates) { - $this->exchangeRates = $exchange_rates; - - return $this; - } - - /** - * {@inheritdoc} - */ public function setLabel($label) { $this->label = $label; diff --git a/src/Entity/Currency/CurrencyForm.php b/src/Entity/Currency/CurrencyForm.php index 8a14270..acff283 100644 --- a/src/Entity/Currency/CurrencyForm.php +++ b/src/Entity/Currency/CurrencyForm.php @@ -80,7 +80,6 @@ class CurrencyForm extends EntityForm { $values = $form_state->getValues(); $currency->setCurrencyCode($values['currency_code']); $currency->setCurrencyNumber($values['currency_number']); - $currency->setExchangeRates(array()); $currency->setLabel($values['label']); $currency->setSign($values['sign']); $currency->setSubunits($values['subunits']); @@ -119,8 +118,6 @@ class CurrencyForm extends EntityForm { '#type' => 'textfield', ); - // @todo add missing UI for exchange rates. - $form['status'] = array( '#default_value' => $currency->status(), '#title' => $this->t('Enabled'), diff --git a/src/Entity/CurrencyInterface.php b/src/Entity/CurrencyInterface.php index 638022e..4c47e0b 100644 --- a/src/Entity/CurrencyInterface.php +++ b/src/Entity/CurrencyInterface.php @@ -151,20 +151,6 @@ interface CurrencyInterface extends ConfigEntityInterface { */ public function getDecimals(); - - /** - * Gets the exchange rates for this currency. - */ - public function getExchangeRates(); - - /** - * Returns the exchange rates for this currency. - * - * @param array $exchange_rates - * An array with exchange rates from one currency to another. - */ - public function setExchangeRates(array $exchange_rates); - /** * Format an amount using this currency and the environment's default currency locale. * pattern. diff --git a/src/Tests/Entity/Currency/CurrencyDeleteFormWebTest.php b/src/Tests/Entity/Currency/CurrencyDeleteFormWebTest.php index c60ec1e..b117411 100644 --- a/src/Tests/Entity/Currency/CurrencyDeleteFormWebTest.php +++ b/src/Tests/Entity/Currency/CurrencyDeleteFormWebTest.php @@ -28,7 +28,6 @@ class CurrencyDeleteFormWebTest extends WebTestBase { $this->drupalLogin($user); $currency = Currency::create([ 'currencyCode' => 'ABC', - 'exchangeRates' => [], ]); $currency->save(); $this->drupalPostForm('admin/config/regional/currency/' . $currency->id() . '/delete', array(), t('Delete'));