You are here

function uc_file_get_by_id in Ubercart 6.2

Same name and namespace in other branches
  1. 8.4 uc_file/uc_file.module \uc_file_get_by_id()
  2. 7.3 uc_file/uc_file.module \uc_file_get_by_id()

Retrieves a file by ID.

Parameters

$fid: A file ID.

Return value

A uc_file object.

8 calls to uc_file_get_by_id()
uc_file_admin_files_form_action in uc_file/uc_file.admin.inc
Performs file action (upload, delete, hooked in actions).
uc_file_remove_user_file_by_id in uc_file/uc_file.module
Removes a user's downloadable file by hash key.
uc_file_user_renew in uc_file/uc_file.module
Adds a file (or files) to a user's list of downloadable files, accumulating limits.
_uc_file_build_js_file_display in uc_file/uc_file.admin.inc
Shows all possible files in selectable list.
_uc_file_gather_files in uc_file/uc_file.module
Retrieves an updated list of available downloads.

... See full list

File

uc_file/uc_file.module, line 1645

Code

function &uc_file_get_by_id($fid) {
  $cache = _uc_file_get_cache();
  if (!isset($cache[$fid])) {
    $cache[$fid] = db_fetch_object(db_query("SELECT * FROM {uc_files} WHERE fid = %d", $fid));
  }
  return $cache[$fid];
}