You are here

function file_entity_revisions_uuid_entity_features_rebuild_alter in UUID Features Integration 7

Implements hook_uuid_entity_features_rebuild_alter().

File

includes/modules/file_entity_revisions.inc, line 21
uuid features hooks on behalf of the file entity module.

Code

function file_entity_revisions_uuid_entity_features_rebuild_alter($entity_type, &$entity, $data, $module) {
  if ($entity_type != 'file') {
    return;
  }

  // Set latest revision id if possible.
  if (isset($entity->fid)) {
    $existing_file = file_entity_revision_load($entity->fid, NULL, TRUE);
    $entity->vid = $existing_file->vid;
  }
}