You are here

public function ConfigImporter::getImportableCurrencyLocales in Currency 8.3

Gets all currency locales that can be imported.

Return value

\Drupal\currency\Entity\CurrencyLocaleInterface[]

Overrides ConfigImporterInterface::getImportableCurrencyLocales

File

src/ConfigImporter.php, line 120

Class

ConfigImporter
Provides a config importer.

Namespace

Drupal\currency

Code

public function getImportableCurrencyLocales() {
  $existing_currency_locales = $this->currencyLocaleStorage
    ->loadMultiple();
  $currency_locales = [];
  $prefix = 'currency.currency_locale.';
  foreach ($this
    ->getConfigStorage()
    ->listAll($prefix) as $name) {
    if (!isset($existing_currency_locales[substr($name, strlen($prefix))])) {
      $currency_locales[] = $this->currencyLocaleStorage
        ->create($this
        ->getConfigStorage()
        ->read($name));
    }
  }
  return $currency_locales;
}