src/ShopBundle/objects/db/TShopVoucher.class.php
public function CommitVoucherUseForCurrentUser($iShopOrderId)
    {
        $oShopVoucherUse = TdbShopVoucherUse::GetNewInstance();
        /** @var $oShopvoucherUse TdbShopVoucherUse */
        $aData = array('shop_voucher_id' => $this->id, 'date_used' => date('Y-m-d H:i:s'), 'value_used' => $this->GetValue(), 'shop_order_id' => $iShopOrderId);
        // hook to post-convert value (as may be required when dealing with currency)
        $this->CommitVoucherUseForCurrentUserPreSaveHook($aData);
        $oShopVoucherUse->LoadFromRow($aData);
        $oShopVoucherUse->AllowEditByAll(true);
        $oShopVoucherUse->Save();

        if ($this->checkMarkVoucherAsCompletelyUsed()) {
            $this->MarkVoucherAsCompletelyUsed();
        }
    }
public function CommitVoucherUseForCurrentUser($iShopOrderId)
    {
        $oShopVoucherUse = TdbShopVoucherUse::GetNewInstance();
        /** @var $oShopvoucherUse TdbShopVoucherUse */
        $aData = array('shop_voucher_id' => $this->id, 'date_used' => date('Y-m-d H:i:s'), 'value_used' => $this->GetValue(), 'shop_order_id' => $iShopOrderId);
        // hook to post-convert value (as may be required when dealing with currency)
        $this->CommitVoucherUseForCurrentUserPreSaveHook($aData);
        $oShopVoucherUse->LoadFromRow($aData);
        $oShopVoucherUse->AllowEditByAll(true);
        $oShopVoucherUse->Save();

        if ($this->checkMarkVoucherAsCompletelyUsed()) {
            $this->MarkVoucherAsCompletelyUsed();
        }
    }
public function CommitVoucherUseForCurrentUser ( $ iShopOrderId ) { $ oShopVoucherUse = TdbShopVoucherUse :: GetNewInstance ( ) ; /** @var $oShopvoucherUse TdbShopVoucherUse */ $ aData = array ( 'shop_voucher_id' => $ this -> id , 'date_used' => date ( 'Y-m-d H:i:s' ) , 'value_used' => $ this -> GetValue ( ) , 'shop_order_id' => $ iShopOrderId ) ; // hook to post-convert value (as may be required when dealing with currency) $ this -> CommitVoucherUseForCurrentUserPreSaveHook ( $ aData ) ; $ oShopVoucherUse -> LoadFromRow ( $ aData ) ; $ oShopVoucherUse -> AllowEditByAll ( true ) ; $ oShopVoucherUse -> Save ( ) ; if ( $ this -> checkMarkVoucherAsCompletelyUsed ( ) ) { $ this -> MarkVoucherAsCompletelyUsed ( ) ; } }
marks the voucher as used in the database, and logs the voucher  data for the current user
in the shop_voucher_use table.

@param int $iShopOrderId - the order for which the voucher is being used
marks the voucher as used in the database and logs the voucher data for the current user in the shop_voucher_use table .