コード例 #1
0
 /**
  * Extract currency from code or object
  *
  * @param string|ICurrency $currency
  * @return ICurrency
  * @throws CurrencyNotFoundException
  */
 private function getCurrency($currency)
 {
     if (!$currency instanceof ICurrency) {
         $code = $currency;
         $currency = $this->currencyManager->getCurrency($code);
         if (!$currency instanceof ICurrency) {
             throw new CurrencyNotFoundException($code);
         }
     }
     return $currency;
 }
コード例 #2
0
 /**
  * Get base currency of provider
  * @return ICurrency
  */
 public function getBaseCurrency()
 {
     return $this->currencyManager->getCurrency('USD');
 }