You are here

function uc_coupon_save in Ubercart Discount Coupons 7.3

Same name and namespace in other branches
  1. 6 uc_coupon.module \uc_coupon_save()
  2. 7.2 uc_coupon.entity.inc \uc_coupon_save()

Save a coupon object.

If the 'cid' field is set, then this will update an existing coupon. Otherwise, a new bulk seed will be generated, the coupon will be inserted into the database, and $coupon->cid will be set.

Parameters

$coupon: The coupon to save.

$edit: An optional array of extra data that other modules may need to save.

5 calls to uc_coupon_save()
UcCouponTestCase::testCoupon in tests/uc_coupon.test
uc_coupon_add_form_submit in ./uc_coupon.admin.inc
Coupon form submit handler.
uc_coupon_purchase_assign_action in uc_coupon_purchase/uc_coupon_purchase.rules.inc
Action callback to assign a coupon to a user.
uc_coupon_purchase_create in uc_coupon_purchase/uc_coupon_purchase.module
Create newly purchased coupons, based on the supplied coupon object.
uc_coupon_workflow_assign in uc_coupon_workflow/uc_coupon_workflow.rules.inc
Action callback to assign a coupon to a user.

File

./uc_coupon.module, line 2184
Provides discount codes and gift certificates for Ubercart.

Code

function uc_coupon_save(&$coupon, $edit = array()) {
  entity_save('uc_coupon', $coupon);
}