You are here

function uc_coupon_load in Ubercart Discount Coupons 7.3

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

Loads one coupon entity from the database.

9 calls to uc_coupon_load()
UcCouponTestCase::createCoupon in tests/uc_coupon.test
uc_coupon_data_property_get in ./uc_coupon.entity.inc
Generic getter to extract properties from the coupon data array.
uc_coupon_find in ./uc_coupon.module
Load a coupon (single or bulk) from the supplied code.
uc_coupon_handler_field_codes::pre_render in views/uc_coupon_handler_field_codes.inc
Expand the coupon codes for each coupon in the result set.
uc_coupon_purchase_assign_action in uc_coupon_purchase/uc_coupon_purchase.rules.inc
Action callback to assign a coupon to a user.

... See full list

File

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

Code

function uc_coupon_load($cid, $reset = FALSE) {
  if (is_null($cid) || $cid < 1) {
    return FALSE;
  }
  $coupons = uc_coupon_load_multiple(array(
    $cid,
  ), array(), $reset);
  return $coupons ? reset($coupons) : FALSE;
}