protected function getCurrency($currencyCode, $locale)
    {
        if (!isset($this->currencies[$currencyCode][$locale])) {
            try {
                $currency = $this->currencyRepository->get($currencyCode, $locale);
            } catch (UnknownCurrencyException $e) {
                // The requested currency was not found. Fall back
                // to a dummy object to show just the currency code.
                $currency = new Currency([
                   'currency_code' => $currencyCode,
                   'name' => $currencyCode,
                   'numeric_code' => '000',
                   'locale' => $locale,
                ]);
            }
            $this->currencies[$currencyCode][$locale] = $currency;
        }

        return $this->currencies[$currencyCode][$locale];
    }
protected function getCurrency($currencyCode, $locale)
    {
        if (!isset($this->currencies[$currencyCode][$locale])) {
            try {
                $currency = $this->currencyRepository->get($currencyCode, $locale);
            } catch (UnknownCurrencyException $e) {
                // The requested currency was not found. Fall back
                // to a dummy object to show just the currency code.
                $currency = new Currency([
                   'currency_code' => $currencyCode,
                   'name' => $currencyCode,
                   'numeric_code' => '000',
                   'locale' => $locale,
                ]);
            }
            $this->currencies[$currencyCode][$locale] = $currency;
        }

        return $this->currencies[$currencyCode][$locale];
    }
protected function getCurrency ( $ currencyCode , $ locale ) { if ( ! isset ( $ this -> currencies [ $ currencyCode ] [ $ locale ] ) ) { try { $ currency = $ this -> currencyRepository -> get ( $ currencyCode , $ locale ) ; } catch ( UnknownCurrencyException $ e ) { // The requested currency was not found. Fall back // to a dummy object to show just the currency code. $ currency = new Currency ( [ 'currency_code' => $ currencyCode , 'name' => $ currencyCode , 'numeric_code' => '000' , 'locale' => $ locale , ] ) ; } $ this -> currencies [ $ currencyCode ] [ $ locale ] = $ currency ; } return $ this -> currencies [ $ currencyCode ] [ $ locale ] ; }
Gets the currency for the provided currency code and locale.

@param string $currencyCode The currency code.
@param string $locale       The locale.

@return Currency
Gets the currency for the provided currency code and locale .