You are here

function commerce_coupon_load in Commerce Coupon 7.2

Same name and namespace in other branches
  1. 7 commerce_coupon.module \commerce_coupon_load()

Fetch a coupon entity.

Parameters

int $coupon_id: A coupon id.

bool $reset: Whether or not to reset the entity cache.

Return value

object|bool A fully-loaded $commerce_coupon object or FALSE if it cannot be loaded.

See also

commerce_coupon_load_multiple()

4 calls to commerce_coupon_load()
CommerceCouponTest::testCommerceCouponCouponCount in ./commerce_coupon.test
commerce_coupon_handler_field_discount_value_display::render in includes/views/handlers/commerce_coupon_handler_field_discount_value_display.inc
Overrides parent::render().
commerce_coupon_load_by_code in ./commerce_coupon.module
Loads a coupon by its coupon code.
commerce_coupon_usage_get_max_usage in modules/usage/commerce_coupon_usage.module
Get the maximum allowed uses for a particular coupon.

File

./commerce_coupon.module, line 949
Provides coupon functionality for Drupal Commerce.

Code

function commerce_coupon_load($coupon_id, $reset = FALSE) {
  $commerce_coupons = commerce_coupon_load_multiple(array(
    $coupon_id,
  ), array(), $reset);
  return reset($commerce_coupons);
}