You are here

function user_revision_entity_info_alter in User Revision 7.2

Same name and namespace in other branches
  1. 7 user_revision.module \user_revision_entity_info_alter()

Implements hook_entity_info_alter().

File

./user_revision.module, line 259
Enables user revision.

Code

function user_revision_entity_info_alter(&$entity_info) {
  module_load_install('user_revision');
  $entity_info['user']['revision table'] = 'user_revision';
  $entity_info['user']['entity keys']['revision'] = 'vid';
  $entity_info['user']['controller class'] = 'UserRevisionController';
  $entity_info['user']['view modes'] += array(
    'revision' => array(
      'label' => t('Revision display'),
      'custom settings' => FALSE,
    ),
  );
  $schema = user_revision_schema();
  foreach ($schema['user_revision']['fields'] as $k => $field) {
    $entity_info['user']['schema_fields_sql']['revision table'][] = $k;
  }
}