public function getExchangeRateList()
    {
        if (!empty($this->exchangeRateList)) {
            return $this->exchangeRateList;
        }

        $this->exchangeRateList = [];

        $currencyBase = $this
            ->currencyRepository
            ->findOneBy([
                'iso' => $this->exchangeCurrencyIso,
            ]);

        $availableExchangeRates = $this
            ->currencyExchangeRateRepository
            ->findBy([
                'sourceCurrency' => $currencyBase,
            ]);

        /**
         * @var CurrencyExchangeRate $exchangeRate
         */
        foreach ($availableExchangeRates as $exchangeRate) {
            $targetCurrency = $exchangeRate->getTargetCurrency();
            $targetCurrencyIso = $targetCurrency->getIso();

            $this->exchangeRateList[$targetCurrencyIso] = [
                'rate' => $exchangeRate->getExchangeRate(),
                'currency' => $targetCurrency,
            ];
        }

        return $this->exchangeRateList;
    }
public function getExchangeRateList()
    {
        if (!empty($this->exchangeRateList)) {
            return $this->exchangeRateList;
        }

        $this->exchangeRateList = [];

        $currencyBase = $this
            ->currencyRepository
            ->findOneBy([
                'iso' => $this->exchangeCurrencyIso,
            ]);

        $availableExchangeRates = $this
            ->currencyExchangeRateRepository
            ->findBy([
                'sourceCurrency' => $currencyBase,
            ]);

        /**
         * @var CurrencyExchangeRate $exchangeRate
         */
        foreach ($availableExchangeRates as $exchangeRate) {
            $targetCurrency = $exchangeRate->getTargetCurrency();
            $targetCurrencyIso = $targetCurrency->getIso();

            $this->exchangeRateList[$targetCurrencyIso] = [
                'rate' => $exchangeRate->getExchangeRate(),
                'currency' => $targetCurrency,
            ];
        }

        return $this->exchangeRateList;
    }
public function getExchangeRateList ( ) { if ( ! empty ( $ this -> exchangeRateList ) ) { return $ this -> exchangeRateList ; } $ this -> exchangeRateList = [ ] ; $ currencyBase = $ this -> currencyRepository -> findOneBy ( [ 'iso' => $ this -> exchangeCurrencyIso , ] ) ; $ availableExchangeRates = $ this -> currencyExchangeRateRepository -> findBy ( [ 'sourceCurrency' => $ currencyBase , ] ) ; /**
         * @var CurrencyExchangeRate $exchangeRate
         */ foreach ( $ availableExchangeRates as $ exchangeRate ) { $ targetCurrency = $ exchangeRate -> getTargetCurrency ( ) ; $ targetCurrencyIso = $ targetCurrency -> getIso ( ) ; $ this -> exchangeRateList [ $ targetCurrencyIso ] = [ 'rate' => $ exchangeRate -> getExchangeRate ( ) , 'currency' => $ targetCurrency , ] ; } return $ this -> exchangeRateList ; }
Given a the currency base, returns a list of all exchange rates.

@return array Exchange rate list
Given a the currency base returns a list of all exchange rates .