function file_load

Loads a single file entity from the database.

Parameters

$fid: A file ID.

Return value

Drupal\file\File A file entity or FALSE if the file was not found.

See also

hook_file_load()

file_load_multiple()

53 calls to file_load()

File

drupal/core/modules/file/file.module, line 121
Defines a "managed_file" Form API field and a "file" field for Field module.

Code

function file_load($fid) {
  $files = file_load_multiple(array(
    $fid,
  ));
  return reset($files);
}