You are here

public function FixedRates::loadAll in Currency 8.3

1 call to FixedRates::loadAll()
FixedRates::save in src/Plugin/Currency/ExchangeRateProvider/FixedRates.php
Saves an exchange rate.

File

src/Plugin/Currency/ExchangeRateProvider/FixedRates.php, line 58

Class

FixedRates
Provides manually entered exchange rates.

Namespace

Drupal\currency\Plugin\Currency\ExchangeRateProvider

Code

public function loadAll() {
  $rates_data = $this->configFactory
    ->get('currency.exchanger.fixed_rates')
    ->get('rates');
  $rates = array();
  foreach ($rates_data as $rate_data) {
    $rates[$rate_data['currency_code_from']][$rate_data['currency_code_to']] = $rate_data['rate'];
  }
  return $rates;
}