You are here

function uc_coupon_delete in Ubercart Discount Coupons 7.2

Same name and namespace in other branches
  1. 7.3 uc_coupon.module \uc_coupon_delete()
1 call to uc_coupon_delete()
uc_coupon_delete_confirm_submit in ./uc_coupon.admin.inc
Delete coupon confirm form submit handler.

File

./uc_coupon.entity.inc, line 75

Code

function uc_coupon_delete($cid) {
  $coupon = uc_coupon_load($cid);
  module_invoke_all('uc_coupon_delete', $coupon);
  db_delete('uc_coupons')
    ->condition('cid', $cid)
    ->execute();
  db_delete('uc_coupons_orders')
    ->condition('cid', $cid)
    ->execute();
  return $coupon;
}