Advertisement
dahousecat

Untitled

Feb 13th, 2014
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.87 KB | None | 0 0
  1. /**
  2.  * Implements hook_field_info().
  3.  *
  4.  */
  5. function emtr_field_info() {
  6.     return array(
  7.         // We name our field as the associative name of the array.
  8.         'field_emtr_denominations' => array(
  9.             'label' => t('Denominations'),
  10.             'description' => t('Field linked to target entity as well as denomination taxonomy term holding denomnation value.'),
  11.             'default_widget' => 'number',
  12.             'default_formatter' => 'number_decimal',
  13.         ),
  14.     );
  15. }
  16.  
  17. /**
  18.  * Implement hook_entity_info().
  19.  *
  20.  */
  21. function emtr_entity_info() {
  22.    
  23.     $return['emtr'] = array(
  24.         'label' => t('EMTR'),
  25.         'plural label' => t('EMTRs'),
  26.         'description' => t('An entity which stores all the emtr data for one shift in one unit.'),
  27.         'entity class' => 'EMTR',
  28.         'controller class' => 'EMTRController',
  29.         'base table' => 'emtr',
  30.         'fieldable' => FALSE,
  31.         'entity keys' => array(
  32.             'id' => 'emtr_id',
  33.         ),
  34.         'label callback' => 'entity_class_label',
  35.         'uri callback' => 'entity_class_uri',
  36.         'creation callback' => 'emtr_create',
  37.         'access callback' => 'emtr_access',
  38.         'module' => 'emtr',
  39.     );
  40.  
  41.     $return['emtr_safe_check'] = array(
  42.         'label' => t('EMTR Safe Check'),
  43.         'plural label' => t('EMTR Safe Checks'),
  44.         'description' => t('An entity which holds safe check data. Can be multiple safe checks per emtr.'),
  45.         'entity class' => 'EMTRSafeCheck',
  46.         'controller class' => 'EMTRSafeCheckController',
  47.         'base table' => 'emtr_safe_check',
  48.         'revision table' => 'emtr_safe_check_revision',
  49.         'fieldable' => FALSE,
  50.         'entity keys' => array(
  51.             'id' => 'safe_check_id',
  52.             'revision' => 'vid',
  53.         ),
  54.         'bundles' => array(
  55.             'emtr_safe_check'=> array(
  56.                 'label' => 'EMTR Safe Check',
  57.             ),
  58.         ),
  59.         'label callback' => 'entity_class_label',
  60.         'uri callback' => 'entity_class_uri',
  61.         'creation callback' => 'emtr_create',
  62.         'access callback' => 'emtr_access',
  63.         'module' => 'emtr',
  64.     );
  65.  
  66.     return $return;
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement