You are here

public function ConfigImporter::getImportableCurrencies in Currency 8.3

Gets all currencies that can be imported.

Return value

\Drupal\currency\Entity\CurrencyInterface[]

Overrides ConfigImporterInterface::getImportableCurrencies

File

src/ConfigImporter.php, line 105

Class

ConfigImporter
Provides a config importer.

Namespace

Drupal\currency

Code

public function getImportableCurrencies() {
  $existing_currencies = $this->currencyStorage
    ->loadMultiple();
  $currencies = [];
  foreach ($this->currencyResourceRepository
    ->listCurrencies() as $currency_code) {
    if (!isset($existing_currencies[$currency_code])) {
      $currencies[$currency_code] = $this
        ->createCurrencyFromRepository($currency_code);
    }
  }
  return $currencies;
}