You are here

function gprofile_entity_info in Group 7

Implements hook_entity_info().

Defines the entities this module needs to function.

File

modules/gprofile/gprofile.entity.inc, line 12
Contains all Entity API functions for the Group member profiles module.

Code

function gprofile_entity_info() {
  $info['gprofile'] = array(
    'label' => t('Group member profile'),
    'plural label' => t('Group member profiles'),
    'description' => t('Fieldable profiles for group members.'),
    'entity class' => 'GProfile',
    'controller class' => 'EntityAPIController',
    'base table' => 'gprofile',
    'fieldable' => TRUE,
    'entity keys' => array(
      'id' => 'pid',
      'bundle' => 'type',
    ),
    'label callback' => 'entity_class_label',
    'uri callback' => 'entity_class_uri',
    // Bundles are set in gprofile_entity_info_alter().
    'bundles' => array(),
    'bundle keys' => array(
      'bundle' => 'name',
    ),
    'view modes' => array(
      'full' => array(
        'label' => t('Member profile'),
        'custom settings' => FALSE,
      ),
    ),
    'module' => 'gprofile',
    'extra fields controller class' => 'GProfileExtraFieldsController',
  );
  $info['gprofile_type'] = array(
    'label' => t('Group member profile type'),
    'plural label' => t('Group member profile types'),
    'description' => t('Define different member profile types.'),
    'entity class' => 'GProfileType',
    'controller class' => 'GProfileTypeController',
    'base table' => 'gprofile_type',
    'fieldable' => FALSE,
    'bundle of' => 'gprofile',
    'exportable' => TRUE,
    'entity keys' => array(
      'id' => 'tid',
      'name' => 'name',
      'label' => 'label',
    ),
    'access callback' => 'gprofile_type_access',
    'label callback' => 'entity_class_label',
    'module' => 'gprofile',
    'admin ui' => array(
      // We set the same path as GroupMembership, but will make sure there
      // are no collisions in GProfileTypeUIController::hook_menu().
      'path' => 'admin/group/member',
      'file' => 'admin/gprofile_type.inc',
      'controller class' => 'GProfileTypeUIController',
    ),
    // Add Internationalization module support.
    'i18n controller class' => 'EntityDefaultI18nStringController',
  );
  return $info;
}