You are here

function user_revision_entity_base_field_info_alter in User Revision 8

Implements hook_entity_base_field_info_alter().

File

./user_revision.module, line 73
User Revision module.

Code

function user_revision_entity_base_field_info_alter(&$fields, EntityTypeInterface $entity_type) {
  if ($entity_type
    ->id() == 'user') {
    $unused_fields = array(
      'uid',
      'uuid',
      'init',
      'created',
      'changed',
      'access',
      'login',
      'vid',
    );
    foreach ($fields as $field_name => $field) {
      if (array_search($field_name, $unused_fields) === FALSE) {
        $field
          ->setRevisionable(TRUE);
      }
    }
  }
}