WellCommerce\Bundle\CurrencyBundle\Entity\Currency::getCode PHP Method

getCode() public method

public getCode ( ) : string
return string
    public function getCode() : string
    {
        return $this->code;
    }

Usage Example

 /**
  * Updates managed currency with exchange rates
  *
  * @param Currency $currency
  */
 protected function updateCurrencyRates(Currency $currency)
 {
     $baseExchangeRate = $this->table[$currency->getCode()];
     foreach ($this->table as $currencySymbol => $exchangeRate) {
         $rate = $this->calculateExchangeRate($baseExchangeRate, $currencySymbol);
         $this->addUpdateExchangeRate($currency->getCode(), $currencySymbol, $rate);
     }
     $this->helper->getEntityManager()->flush();
 }