You are here

function commerce_coupon_create in Commerce Coupon 7.2

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

Create a stub coupon.

Parameters

string $type: A coupon type name.

Return value

object|null A coupon object.

5 calls to commerce_coupon_create()
CommerceCouponTest::testCommerceCouponUICartForm in ./commerce_coupon.test
CommerceCouponTest::testMultipleCouponsSameDiscount in ./commerce_coupon.test
commerce_coupon_form_commerce_discount_form_alter in ./commerce_coupon.module
Implements hook_form_FORM_ID_alter().
commerce_coupon_handler_field_coupon_link::check_access in includes/views/handlers/commerce_coupon_handler_field_coupon_link.inc
Overrides parent::check_access().
commerce_coupon_menu in ./commerce_coupon.module
Implements hook_menu().

File

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

Code

function commerce_coupon_create($type) {
  return entity_get_controller('commerce_coupon')
    ->create(array(
    'type' => $type,
  ));
}