/**
  * Edit the coupon
  *
  * @param integer $id
  * @param array $couponInfo
  *      integer discount
  *      integer date_start
  *      integer date_end
  * @return boolean|string
  */
 public function editCoupon($id, array $couponInfo)
 {
     try {
         $this->adapter->getDriver()->getConnection()->beginTransaction();
         if (!$couponInfo['date_start']) {
             $couponInfo['date_start'] = null;
         }
         if (!$couponInfo['date_end']) {
             $couponInfo['date_end'] = null;
         }
         $update = $this->update()->table('payment_discount_coupon')->set($couponInfo)->where(['id' => $id]);
         $statement = $this->prepareStatementForSqlObject($update);
         $statement->execute();
         $this->adapter->getDriver()->getConnection()->commit();
     } catch (Exception $e) {
         $this->adapter->getDriver()->getConnection()->rollback();
         ApplicationErrorLogger::log($e);
         return $e->getMessage();
     }
     // fire the edit discount coupon event
     PaymentEvent::fireEditDiscountCouponEvent($id);
     return true;
 }