Sets the currencies to return.
Expects either a list of arguments or
a single argument as array

@param  array $currencies
@return Exchange
10443
public function symbols($currencies = null)
    {
        if (func_num_args() and !is_array(func_get_args()[0])) {
            $currencies = func_get_args();
        }

        $this->symbols = $currencies;

        return $this;
    }
1179969
public function setCurrency($currency)
    {
        if ($currency) {
            $currency = strtoupper($currency);
            Currency::getNumericCode($currency); // ensure currency support
            $this->currency = $currency;
        } else {
            $this->currency = null;
        }

        return $this;
    }
1184426
public function forCurrency($currency)
    {
        if (!isset($this->value[$currency])) {
            Yii::warning('Value for currency $currency was not found. Using fake free value. Most probably, tariff is free', __METHOD__);

            return new Value(['value' => 0, 'price' => 0]);
        }

        return $this->value[$currency];
    }
155484
public static function parseByDecimal($money, $forceCurrency = null, Currencies $currencies = null)
    {
        $parser = new DecimalMoneyParser($currencies ?: static::getCurrencies());

        return self::parseByParser($parser, $money, $forceCurrency);
    }
419173
public function exchange(Money $money, $targetCurrency)
    {
        if (is_string($targetCurrency)) {
            $targetCurrency = Currency::create($targetCurrency);
        }

        $exchangeRate = 0;
        return $money->exchange($targetCurrency, $exchangeRate);
    }
690878
protected function setCartItems($items)
    {
        return (new Collection($items))->map(function ($item, $num) {
            return [
                'L_PAYMENTREQUEST_0_NAME'.$num => $item['name'],
                'L_PAYMENTREQUEST_0_AMT'.$num  => $item['price'],
                'L_PAYMENTREQUEST_0_QTY'.$num  => isset($item['qty']) ? $item['qty'] : 1,
            ];
        })->flatMap(function ($value) {
            return $value;
        });
    }
225136
public function setTransactionsAttribute($transactions)
    {
        if (!is_array($transactions)) {
            throw new \InvalidArgumentException('Transactions must be an array');
        }

        foreach ($transactions as $key => $transaction) {
            if (!($transaction instanceof Transaction)) {
                $transactions[$key] = new Transaction($transaction);
            }
        }

        $this->attributes['Transactions'] = $transactions;

        return $this;
    }
1196455
public function exchange(Money $money, $roundingMode = Money::ROUND_HALF_UP)
    {
        if ($money->getCurrency() != $this->getFromCurrency()) {
            throw new Exception\InvalidArgumentException('The Money has the wrong currency');
        }

        return $money->exchange($this->getToCurrency(), $this->getExchangeRate(), $roundingMode);
    }
852822
private function provideCurrency($currencyCode)
    {
        $currency = $this->currencyRepository->findOneBy(['code' => $currencyCode]);
        if (null === $currency) {
            /** @var CurrencyInterface $currency */
            $currency = $this->createCurrency($currencyCode);

            $this->currencyRepository->add($currency);
        }

        return $currency;
    }
1352359
private function setCurrency(Currency $currency = null)
    {
        if($currency != null)
            $this->currency = $currency;
        else
        {
            $this->currency = new Currency();
        }
    }
596733
public static function getBySymbol(string $symbol): CurrencyCollection
    {
        $currencies = Currency::get();

        /** @var CurrencyCollection $currencies */
        $currencies = $currencies->where("symbol", $symbol);
        return new CurrencyCollection($currencies->elements());
    }
860954
public function setActShopCurrency($cur)
    {
        $currencies = $this->getCurrencyArray();
        if (isset($currencies[$cur])) {
            $this->getSession()->setVariable('currency', $cur);
            $this->_oActCurrencyObject = null;
        }
    }
648472
public void setExchangeRate(Currency otherCurrency, double amount) {
        Common.getInstance().getStorageHandler().getStorageEngine().setExchangeRate(this, otherCurrency, amount);
    }
850137
public function setCurrency($country = null)
    {
        if (is_null($country)) {
            $country = config('currency.default');
        }
        $config = config('currency.' . $country);
        if (empty($config)) {
            throw new CurrencyNotAvaialbleException($country . ' currency not avaialble.');
        }
        $this->currency = $config;

        return $this;
    }
201960
public function formatByDecimal(Currencies $currencies = null)
    {
        $formatter = new DecimalMoneyFormatter($currencies ?: static::getCurrencies());

        return $this->formatByFormatter($formatter);
    }
1287330
public function exchange($name, $options = [])
    {
        if (empty($this->_exchanges[$name])) {
            $channel = $this->channel($name, $options);
            $exchange = new AMQPExchange($channel);
            $exchange->setName($name);

            if (!empty($options['type'])) {
                $exchange->setType($options['type']);
            }

            if (!empty($options['flags'])) {
                $exchange->setFlags($options['flags']);
            }

            $this->_exchanges[$name] = $exchange;
        }

        return $this->_exchanges[$name];
    }
267681
public static function getCurrencies($filter = array())
    {
        $filter = Filter::create($filter);
        return self::getCollection('/currencies' . $filter->toQuery(), 'Currency');
    }