You are here

function commerce_coupon_usage_property_getter in Commerce Coupon 7.2

Entity metadata property getter callback.

Get usage-related information about a coupon.

1 string reference to 'commerce_coupon_usage_property_getter'
commerce_coupon_usage_entity_property_info_alter in modules/usage/commerce_coupon_usage.info.inc
@file Implements hook_entity_property_info_alter().

File

modules/usage/commerce_coupon_usage.module, line 72

Code

function commerce_coupon_usage_property_getter($coupon, array $options, $name) {
  switch ($name) {
    case 'usage':
      return commerce_coupon_usage_get_usage($coupon->coupon_id);
    case 'max_usage':
      return commerce_coupon_usage_get_max_usage($coupon->coupon_id);
  }
}