You are here

function l10n_update_file_history in Localization update 7

Same name and namespace in other branches
  1. 6 l10n_update.inc \l10n_update_file_history()

Update the file history table.

Parameters

$file: Object representing the file just imported or downloaded.

Return value

integer FALSE on failure. Otherwise SAVED_NEW or SAVED_UPDATED. @see drupal_write_record()

1 call to l10n_update_file_history()
l10n_update_source_history in ./l10n_update.check.inc
Update the file history table and delete the file if temporary.

File

./l10n_update.inc, line 191

Code

function l10n_update_file_history($file) {

  // Update or write new record
  if (db_query("SELECT project FROM {l10n_update_file} WHERE project = :project AND language = :language", array(
    ':project' => $file->project,
    ':language' => $file->language,
  ))
    ->fetchField()) {
    $update = array(
      'project',
      'language',
    );
  }
  else {
    $update = array();
  }
  return drupal_write_record('l10n_update_file', $file, $update);
}