You are here

function log_entity_info in Log entity 7

Implements hook_entity_info().

File

./log.module, line 178
Log - A general purpose record keeping system.

Code

function log_entity_info() {
  $return = array(
    'log' => array(
      'label' => t('Log'),
      'entity class' => 'Log',
      'controller class' => 'LogController',
      'base table' => 'log',
      'fieldable' => TRUE,
      'entity keys' => array(
        'id' => 'id',
        'bundle' => 'type',
        'label' => 'name',
      ),
      'bundle keys' => array(
        'bundle' => 'type',
      ),
      'bundles' => array(),
      'load hook' => 'log_load',
      'view modes' => array(
        'full' => array(
          'label' => t('Default'),
          'custom settings' => FALSE,
        ),
      ),
      'label callback' => 'entity_class_label',
      'uri callback' => 'entity_class_uri',
      'module' => 'log',
      'access callback' => 'log_access',
    ),
  );
  $return['log_type'] = array(
    'label' => t('Log type'),
    'entity class' => 'LogType',
    'controller class' => 'LogTypeController',
    'base table' => 'log_type',
    'fieldable' => FALSE,
    'bundle of' => 'log',
    'exportable' => TRUE,
    'entity keys' => array(
      'id' => 'id',
      'name' => 'type',
      'label' => 'label',
    ),
    'module' => 'log',
    // Enable the entity API admin UI.
    'admin ui' => array(
      'path' => 'admin/config/log/types',
      'file' => 'log.admin.inc',
      'controller class' => 'LogTypeUIController',
    ),
    'access callback' => 'log_type_access',
  );
  return $return;
}