protected function calculateExchangeRateBetweenIsos(
        $currencyFromIso,
        $currencyToIso
    ) {
        $currencyExchangeRates = $this->currencyManager->getExchangeRateList();

        /**
         * We are calculating the exchange from the default currency.
         */
        if (
            $this->defaultExchangeCurrencyIso == $currencyFromIso &&
            isset($currencyExchangeRates[$currencyToIso])
        ) {
            $exchangeRate = $currencyExchangeRates[$currencyToIso]['rate'];
        } /**
         * We are calculating the exchange to the default currency.
         */
        elseif (
            $this->defaultExchangeCurrencyIso == $currencyToIso &&
            isset($currencyExchangeRates[$currencyFromIso])
        ) {
            $exchangeRate = 1 / $currencyExchangeRates[$currencyFromIso]['rate'];
        } /**
         * We use the default money as a bridge to calculate the exchange rate.
         */
        elseif (
            isset($currencyExchangeRates[$currencyFromIso]) &&
            isset($currencyExchangeRates[$currencyToIso])
        ) {
            $exchangeRate = 1 / $currencyExchangeRates[$currencyFromIso]['rate']
                * $currencyExchangeRates[$currencyToIso]['rate'];
        } /**
         * If we reach this point we don't know how to calculate the exchange.
         */
        else {
            throw new CurrencyNotConvertibleException();
        }

        return $exchangeRate;
    }
protected function calculateExchangeRateBetweenIsos(
        $currencyFromIso,
        $currencyToIso
    ) {
        $currencyExchangeRates = $this->currencyManager->getExchangeRateList();

        /**
         * We are calculating the exchange from the default currency.
         */
        if (
            $this->defaultExchangeCurrencyIso == $currencyFromIso &&
            isset($currencyExchangeRates[$currencyToIso])
        ) {
            $exchangeRate = $currencyExchangeRates[$currencyToIso]['rate'];
        } /**
         * We are calculating the exchange to the default currency.
         */
        elseif (
            $this->defaultExchangeCurrencyIso == $currencyToIso &&
            isset($currencyExchangeRates[$currencyFromIso])
        ) {
            $exchangeRate = 1 / $currencyExchangeRates[$currencyFromIso]['rate'];
        } /**
         * We use the default money as a bridge to calculate the exchange rate.
         */
        elseif (
            isset($currencyExchangeRates[$currencyFromIso]) &&
            isset($currencyExchangeRates[$currencyToIso])
        ) {
            $exchangeRate = 1 / $currencyExchangeRates[$currencyFromIso]['rate']
                * $currencyExchangeRates[$currencyToIso]['rate'];
        } /**
         * If we reach this point we don't know how to calculate the exchange.
         */
        else {
            throw new CurrencyNotConvertibleException();
        }

        return $exchangeRate;
    }
protected function calculateExchangeRateBetweenIsos ( $ currencyFromIso , $ currencyToIso ) { $ currencyExchangeRates = $ this -> currencyManager -> getExchangeRateList ( ) ; /**
         * We are calculating the exchange from the default currency.
         */ if ( $ this -> defaultExchangeCurrencyIso == $ currencyFromIso && isset ( $ currencyExchangeRates [ $ currencyToIso ] ) ) { $ exchangeRate = $ currencyExchangeRates [ $ currencyToIso ] [ 'rate' ] ; } /**
         * We are calculating the exchange to the default currency.
         */ elseif ( $ this -> defaultExchangeCurrencyIso == $ currencyToIso && isset ( $ currencyExchangeRates [ $ currencyFromIso ] ) ) { $ exchangeRate = 1 / $ currencyExchangeRates [ $ currencyFromIso ] [ 'rate' ] ; } /**
         * We use the default money as a bridge to calculate the exchange rate.
         */ elseif ( isset ( $ currencyExchangeRates [ $ currencyFromIso ] ) && isset ( $ currencyExchangeRates [ $ currencyToIso ] ) ) { $ exchangeRate = 1 / $ currencyExchangeRates [ $ currencyFromIso ] [ 'rate' ] * $ currencyExchangeRates [ $ currencyToIso ] [ 'rate' ] ; } /**
         * If we reach this point we don't know how to calculate the exchange.
         */ else { throw new CurrencyNotConvertibleException ( ) ; } return $ exchangeRate ; }
Calculates the exchange rate between ISOs.

@param string $currencyFromIso The currency ISO we are converting from.
@param string $currencyToIso   The currency ISO we are converting to.

@return float

@throws CurrencyNotConvertibleException
Calculates the exchange rate between ISOs .