You are here

function deploy_uuid_file_insert in Deploy - Content Staging 6

Implementation of hook_file_insert().

Add files UUID to appropriate table.

File

modules/deploy_uuid/deploy_uuid.module, line 45
Deployment UUID management

Code

function deploy_uuid_file_insert($file) {

  // Ensure that $file is an object.
  if (!is_object($file)) {
    $file = (object) $file;
  }
  if ($file->uuid) {
    db_query("INSERT INTO {files_uuid} (fid, uuid) VALUES (%d, '%s')", $file->fid, $file->uuid);
  }
  else {
    db_query("INSERT INTO {files_uuid} (fid, uuid) VALUES (%d, '%s')", $file->fid, deploy_uuid_create_uuid());
  }
}