/**
  * Add new currency
  *
  * @param array $currencyInfo
  *      string code
  *      sting name
  *      integer primary_currency
  * @return integer|string
  */
 public function addCurrency(array $currencyInfo)
 {
     try {
         $this->adapter->getDriver()->getConnection()->beginTransaction();
         if (!$currencyInfo['primary_currency']) {
             $currencyInfo['primary_currency'] = self::NOT_PRIMARY_CURRENCY;
         }
         $insert = $this->insert()->into('payment_currency')->values($currencyInfo);
         $statement = $this->prepareStatementForSqlObject($insert);
         $statement->execute();
         $insertId = $this->adapter->getDriver()->getLastGeneratedValue();
         // skip the previously activated primary currency
         if ((int) $currencyInfo['primary_currency'] == self::PRIMARY_CURRENCY) {
             $this->skippActivatedPrimaryCurrency($insertId);
             $this->clearExchangeRates();
             $this->cleanShoppingCart();
         }
         $this->adapter->getDriver()->getConnection()->commit();
     } catch (Exception $e) {
         $this->adapter->getDriver()->getConnection()->rollback();
         ApplicationErrorLogger::log($e);
         return $e->getMessage();
     }
     // fire the add payment currency event
     PaymentEvent::fireAddPaymentCurrencyEvent($insertId);
     return $insertId;
 }