You are here

function commerce_coupon_entity_info in Commerce Coupon 7

Same name and namespace in other branches
  1. 7.2 commerce_coupon.module \commerce_coupon_entity_info()

Implements hook_entity_info().

This function provides information about the coupon entities.

File

./commerce_coupon.module, line 16
Coupon System for Drupal Commerce.

Code

function commerce_coupon_entity_info() {
  $entity_info['commerce_coupon'] = array(
    'label' => t('Commerce Coupon'),
    'plural label' => t('Commerce Coupons'),
    'controller class' => 'CommerceCouponEntityController',
    'base table' => 'commerce_coupon',
    'fieldable' => TRUE,
    'entity keys' => array(
      'id' => 'coupon_id',
      'bundle' => 'type',
    ),
    'bundles' => array(),
    'bundle keys' => array(
      'bundle' => 'type',
    ),
    'module' => 'commerce_coupon',
    'permission labels' => array(
      'singular' => t('coupon'),
      'plural' => t('coupons'),
    ),
    'access callback' => 'commerce_entity_access',
    'access arguments' => array(
      'user key' => 'uid',
      'access tag' => 'commerce_coupon_access',
    ),
  );
  $entity_info['commerce_coupon_type'] = array(
    'label' => t('Commerce Coupon Type'),
    'plural label' => t('Commerce Coupon Types'),
    'entity class' => 'CommerceCouponType',
    'controller class' => 'EntityAPIControllerExportable',
    'base table' => 'commerce_coupon_type',
    'fieldable' => FALSE,
    'bundle of' => 'commerce_coupon',
    'exportable' => FALSE,
    'entity keys' => array(
      'id' => 'type',
      'label' => 'label',
    ),
    'access callback' => 'commerce_coupon_type_access',
    'module' => 'commerce_coupon',
  );
  return $entity_info;
}