function commerce_option_entity_info in Commerce Product Option 7.2
Same name and namespace in other branches
- 7 commerce_option.module \commerce_option_entity_info()
Implements hook_entity_info().
This function provides information about the option entities.
File
- ./
commerce_option.module, line 51
Code
function commerce_option_entity_info() {
$return = array();
$return['commerce_option'] = array(
'label' => t('Commerce Option'),
'entity class' => 'Entity',
'controller class' => 'EntityAPIController',
'views controller class' => 'EntityDefaultViewsController',
'base table' => 'commerce_option',
'fieldable' => TRUE,
'load hook' => 'commerce_option_load',
'entity keys' => array(
'id' => 'option_id',
'bundle' => 'set_id',
'label' => 'set_id',
),
'access callback' => 'commerce_option_set_access',
'creation callback' => 'commerce_option_new',
'module' => 'commerce_option',
'bundle keys' => array(
'bundle' => 'set_id',
),
'bundles' => array(),
'view modes' => array(
'full' => array(
'label' => t('Full content'),
'custom settings' => FALSE,
),
),
'admin ui' => array(
'path' => 'admin/commerce/orders/options',
'file' => 'commerce_option.admin.inc',
'controller class' => 'CommerceOptionUIController',
),
);
$return['commerce_option_set'] = array(
'label' => t('Commerce Option Set'),
'entity class' => 'Entity',
'controller class' => 'EntityAPIControllerExportable',
'views controller class' => 'EntityDefaultViewsController',
'base table' => 'commerce_option_set',
'exportable' => TRUE,
'fieldable' => FALSE,
'load hook' => 'commerce_option_set_load',
'entity keys' => array(
'id' => 'option_set_id',
'label' => 'name',
'name' => 'set_id',
),
'deletion callback' => 'commerce_option_set_delete',
'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' => 'commerce_option.admin.inc',
),
);
return $return;
}