You are here

function commerce_option_entity_info in Commerce Product Option 7

Same name and namespace in other branches
  1. 7.2 commerce_option.module \commerce_option_entity_info()

Implements hook_entity_info()

This function provides informations about the option entities.

File

./commerce_option.module, line 10

Code

function commerce_option_entity_info() {
  $return = array();
  $return['commerce_option'] = array(
    'label' => t('Commerce Option'),
    'entity class' => 'CommerceOption',
    'controller class' => 'EntityAPIController',
    'base table' => 'commerce_option',
    'fieldable' => TRUE,
    'entity keys' => array(
      'id' => 'option_id',
      'bundle' => 'set_id',
      'label' => 'set_id',
    ),
    'access callback' => 'commerce_option_set_access',
    'module' => 'commerce_option',
    'bundle keys' => array(
      'bundle' => 'set_id',
    ),
    'bundles' => array(),
    'view modes' => array(
      'attribute_view' => array(
        'label' => t('Attribute View'),
        'custom settings' => FALSE,
      ),
    ),
  );
  $return['commerce_option_set'] = array(
    'label' => t('Commerce Option Set'),
    'entity class' => 'CommerceOptionSet',
    'controller class' => 'EntityAPIControllerExportable',
    'base table' => 'commerce_option_set',
    'fieldable' => FALSE,
    // TODO: Make the option set exportable
    'exportable' => FALSE,
    'entity keys' => array(
      'id' => 'set_id',
      'label' => 'name',
      'name' => 'set_id',
    ),
    'bundle of' => 'commerce_option',
    'access callback' => 'commerce_option_set_access',
    'module' => 'commerce_option',
    'bundles' => array(),
    'admin ui' => array(
      'path' => 'admin/commerce/products/option-sets',
      'file' => 'includes/commerce_option_set.forms.inc',
    ),
  );
  return $return;
}