function tmgmt_entity_info in Translation Management Tool 7
Implements hook_entity_info().
File
- ./
tmgmt.module, line 133 - Main module file for the Translation Management module.
Code
function tmgmt_entity_info() {
$info['tmgmt_job'] = array(
'label' => t('Translation Management Job'),
'module' => 'tmgmt',
'controller class' => 'TMGMTJobController',
'metadata controller class' => 'TMGMTJobMetadataController',
'views controller class' => 'TMGMTJobViewsController',
'entity class' => 'TMGMTJob',
'base table' => 'tmgmt_job',
'uri callback' => 'entity_class_uri',
'label callback' => 'entity_class_label',
'access callback' => 'tmgmt_job_access',
'entity keys' => array(
'id' => 'tjid',
),
);
$info['tmgmt_job_item'] = array(
'label' => t('Translation Management Job Item'),
'module' => 'tmgmt',
'controller class' => 'TMGMTJobItemController',
'metadata controller class' => 'TMGMTJobItemMetadataController',
'views controller class' => 'TMGMTJobItemViewsController',
'entity class' => 'TMGMTJobItem',
'base table' => 'tmgmt_job_item',
'label callback' => 'entity_class_label',
'uri callback' => 'entity_class_uri',
'access callback' => 'tmgmt_job_item_access',
'entity keys' => array(
'id' => 'tjiid',
),
);
$info['tmgmt_message'] = array(
'label' => t('Translation Management Message'),
'module' => 'tmgmt',
'controller class' => 'EntityAPIController',
'metadata controller class' => 'TMGMTMessageMetadataController',
'views controller class' => 'TMGMTMessageViewsController',
'entity class' => 'TMGMTMessage',
'base table' => 'tmgmt_message',
'label callback' => 'entity_class_label',
'access callback' => 'tmgmt_message_access',
'entity keys' => array(
'id' => 'mid',
),
);
$info['tmgmt_translator'] = array(
'label' => t('Translation Management Translator'),
'module' => 'tmgmt',
'controller class' => 'TMGMTTranslatorController',
'metadata controller class' => 'TMGMTTranslatorMetadataController',
'views controller class' => 'EntityDefaultViewsController',
'entity class' => 'TMGMTTranslator',
'base table' => 'tmgmt_translator',
'exportable' => TRUE,
'access callback' => 'tmgmt_translator_access',
'entity keys' => array(
'id' => 'tid',
'name' => 'name',
'label' => 'label',
),
);
// Make use of the entity cache module if it is enabled.
if (module_exists('entitycache')) {
$info['tmgmt_translator']['entity cache'] = TRUE;
$info['tmgmt_translator']['field cache'] = FALSE;
}
$info['tmgmt_remote'] = array(
'label' => t('Remote job mapping'),
'module' => 'tmgmt',
'controller class' => 'TMGMTRemoteController',
'entity class' => 'TMGMTRemote',
'base table' => 'tmgmt_remote',
'uri callback' => 'entity_class_uri',
'label callback' => 'entity_class_label',
'access callback' => 'tmgmt_remote_access',
'entity keys' => array(
'id' => 'trid',
),
);
return $info;
}