You are here

function redhen_org_entity_info in RedHen CRM 7

Implements hook_entity_info().

File

modules/redhen_org/redhen_org.module, line 14

Code

function redhen_org_entity_info() {
  return array(
    'redhen_org' => array(
      'label' => t('Organization'),
      'plural label' => t('Organizations'),
      'controller class' => 'RedhenOrgEntityController',
      'rules controller class' => 'EntityDefaultRulesController',
      'metadata controller class' => 'RedhenOrgMetadataController',
      'views controller class' => 'RedhenOrgViewsController',
      'entity class' => 'RedhenOrg',
      'inline entity form' => array(
        'controller' => 'RedHenOrgInlineEntityFormController',
      ),
      'base table' => 'redhen_org',
      'revision table' => 'redhen_org_revision',
      'fieldable' => TRUE,
      'entity keys' => array(
        'id' => 'org_id',
        'revision' => 'revision_id',
        'bundle' => 'type',
        'label' => 'label',
      ),
      'bundle keys' => array(
        'bundle' => 'name',
      ),
      'bundles' => array(),
      'view modes' => array(
        'full' => array(
          'label' => t('Full organization'),
          'custom settings' => FALSE,
        ),
        'teaser' => array(
          'label' => t('Teaser'),
          'custom settings' => TRUE,
        ),
      ),
      'uri callback' => 'entity_class_uri',
      'token type' => 'redhen_org',
      'module' => 'redhen_org',
      'label callback' => 'entity_class_label',
      'access callback' => 'redhen_org_access',
    ),
    'redhen_org_type' => array(
      'label' => t('Organization type'),
      'entity class' => 'RedhenOrgType',
      'controller class' => 'RedhenOrgTypeController',
      'base table' => 'redhen_org_type',
      'fieldable' => FALSE,
      'bundle of' => 'redhen_org',
      'exportable' => TRUE,
      'token type' => 'redhen_org_type',
      'entity keys' => array(
        'id' => 'org_type_id',
        'name' => 'name',
        'label' => 'label',
      ),
      'access callback' => 'redhen_org_type_access',
      'module' => 'redhen_org',
      // Enable the entity API's admin UI.
      'admin ui' => array(
        'path' => 'admin/structure/redhen/org_types',
        'file' => 'redhen_org_type.admin.inc',
        'file path' => drupal_get_path('module', 'redhen_org') . '/includes',
        'controller class' => 'RedhenOrgTypeUIController',
      ),
    ),
  );
}