function redhen_contact_entity_info in RedHen CRM 7
Implements hook_entity_info().
File
- modules/
redhen_contact/ redhen_contact.module, line 31 - Module file for RedHen contacts.
Code
function redhen_contact_entity_info() {
return array(
'redhen_contact' => array(
'label' => t('Contact'),
'plural label' => t('Contacts'),
'controller class' => 'RedhenContactEntityController',
'metadata controller class' => 'RedhenContactMetadataController',
'rules controller class' => 'EntityDefaultRulesController',
'entity class' => 'RedhenContact',
'views controller class' => 'RedhenContactViewsController',
'inline entity form' => array(
'controller' => 'RedHenContactInlineEntityFormController',
),
'base table' => 'redhen_contact',
'revision table' => 'redhen_contact_revision',
'fieldable' => TRUE,
'entity keys' => array(
'id' => 'contact_id',
'revision' => 'revision_id',
'bundle' => 'type',
),
'bundle keys' => array(
'bundle' => 'name',
),
'bundles' => array(),
'view modes' => array(
'full' => array(
'label' => t('Full contact'),
'custom settings' => FALSE,
),
'teaser' => array(
'label' => t('Teaser'),
'custom settings' => TRUE,
),
),
'uri callback' => 'entity_class_uri',
'token type' => 'redhen_contact',
'module' => 'redhen_contact',
'label callback' => 'entity_class_label',
'access callback' => 'redhen_contact_access',
),
'redhen_contact_type' => array(
'label' => t('Contact type'),
'entity class' => 'RedhenContactType',
'controller class' => 'RedhenContactTypeController',
'base table' => 'redhen_contact_type',
'fieldable' => FALSE,
'bundle of' => 'redhen_contact',
'exportable' => TRUE,
'token type' => 'redhen_contact_type',
'entity keys' => array(
'id' => 'contact_type_id',
'name' => 'name',
'label' => 'label',
),
'access callback' => 'redhen_contact_type_access',
'module' => 'redhen_contact',
// Enable the entity API's admin UI.
'admin ui' => array(
'path' => 'admin/structure/redhen/contact_types',
'file' => 'redhen_contact_type.admin.inc',
'file path' => drupal_get_path('module', 'redhen_contact') . '/includes',
'controller class' => 'RedhenContactTypeUIController',
),
),
);
}