public function CurrencyRepository::get in Price 8
Same name and namespace in other branches
- 3.x src/Repository/CurrencyRepository.php \Drupal\price\Repository\CurrencyRepository::get()
- 2.0.x src/Repository/CurrencyRepository.php \Drupal\price\Repository\CurrencyRepository::get()
- 2.x src/Repository/CurrencyRepository.php \Drupal\price\Repository\CurrencyRepository::get()
- 3.0.x src/Repository/CurrencyRepository.php \Drupal\price\Repository\CurrencyRepository::get()
File
- src/
Repository/ CurrencyRepository.php, line 42
Class
- CurrencyRepository
- Defines the currency repository.
Namespace
Drupal\price\RepositoryCode
public function get($currency_code, $locale = NULL) {
/** @var \Drupal\price\Entity\CurrencyInterface $currency */
$currency = $this->currencyStorage
->load($currency_code);
if (!$currency) {
throw new UnknownCurrencyException($currency_code);
}
return $this
->createValueObjectFromEntity($currency);
}