You are here

public function CurrencyRepository::getAll in Price 8

Same name and namespace in other branches
  1. 3.x src/Repository/CurrencyRepository.php \Drupal\price\Repository\CurrencyRepository::getAll()
  2. 2.0.x src/Repository/CurrencyRepository.php \Drupal\price\Repository\CurrencyRepository::getAll()
  3. 2.x src/Repository/CurrencyRepository.php \Drupal\price\Repository\CurrencyRepository::getAll()
  4. 3.0.x src/Repository/CurrencyRepository.php \Drupal\price\Repository\CurrencyRepository::getAll()

File

src/Repository/CurrencyRepository.php, line 55

Class

CurrencyRepository
Defines the currency repository.

Namespace

Drupal\price\Repository

Code

public function getAll($locale = NULL) {
  $all = [];

  /** @var \Drupal\price\Entity\CurrencyInterface[] $currencies */
  $currencies = $this->currencyStorage
    ->loadMultiple();
  foreach ($currencies as $currency_code => $currency) {
    $all[$currency_code] = $this
      ->createValueObjectFromEntity($currency);
  }
  return $all;
}