You are here

protected function ExchangerProviderBase::getCurrencies in Commerce Exchanger 8

Simple key-value array for enabled currencies.

Return value

array Return formatted array of currencies ['HRK' => 'Croatian Kuna'].

2 calls to ExchangerProviderBase::getCurrencies()
ExchangerProviderBase::__construct in src/Plugin/Commerce/ExchangerProvider/ExchangerProviderBase.php
Constructs a new ExchangeProvider object.
ExchangerProviderRemoteBase::processRemoteData in src/Plugin/Commerce/ExchangerProvider/ExchangerProviderRemoteBase.php
Process data with checking structure and preparing data for importing.

File

src/Plugin/Commerce/ExchangerProvider/ExchangerProviderBase.php, line 311

Class

ExchangerProviderBase
Base class for Commerce exchanger provider plugins.

Namespace

Drupal\commerce_exchanger\Plugin\Commerce\ExchangerProvider

Code

protected function getCurrencies() {
  $currency_storage = $this->currencyStorage
    ->loadMultiple();
  $currencies = [];
  foreach ($currency_storage as $currency) {
    $currencies[$currency
      ->getCurrencyCode()] = $currency
      ->label();
  }
  return $currencies;
}