You are here

function _filefield_file_load in FileField 5

Same name and namespace in other branches
  1. 5.2 filefield.module \_filefield_file_load()
2 calls to _filefield_file_load()
filefield_field in ./filefield.module
Implementation of hook_field().
filefield_field_formatter in ./filefield.module

File

./filefield.module, line 459
Defines a file field type.

Code

function _filefield_file_load($fid = NULL) {
  if (isset($fid)) {
    if (is_numeric($fid)) {
      $result = db_query('SELECT * FROM {files} WHERE fid = %d', $fid);
      $file = db_fetch_array($result);
      return $file ? $file : array();
    }
  }
  return array();
}