1. drupal
    1. 8
    2. 7
7 – 8 file_load_multiple($fids = array(), $conditions = array())

Loads file objects from the database.

@todo Remove $conditions in Drupal 8.


$fids An array of file IDs.

$conditions (deprecated) An associative array of conditions on the {file_managed} table, where the keys are the database fields and the values are the values those fields must have. Instead, it is preferable to use EntityFieldQuery to retrieve a list of entity IDs loadable by this function.

Return value

An array of file objects, indexed by fid.

See also





Related topics

▾ 14 functions call file_load_multiple()

FileLoadTest::testLoadInvalidStatus in modules/simpletest/tests/file.test
Try to load a non-existent file by status.
FileLoadTest::testLoadMissingFilepath in modules/simpletest/tests/file.test
Try to load a non-existent file by URI.
FileLoadTest::testMultiple in modules/simpletest/tests/file.test
This will test loading file data from the database.
FileSaveUploadTest::testNormal in modules/simpletest/tests/file.test
Test the file_save_upload() function.
file_copy in includes/
Copies a file to a new location and adds a file record to the database.
file_field_load in modules/file/
Implements hook_field_load().
file_file_download in modules/file/file.module
Implements hook_file_download().
file_load in includes/
Load a file object from the database.
file_move in includes/
Move a file to a new location and update the file's database entry.
file_save_data in includes/
Save a string to the specified destination and create a database file entry.
file_save_upload in includes/
Saves a file upload to a new location.
image_file_download in modules/image/image.module
Implements hook_file_download().
UserController::attachLoad in modules/user/user.module
Attaches data to entities upon loading. This will attach fields, if the entity is fieldable. It calls hook_entity_load() for modules which need to add data to all entities. It also calls hook_TYPE_load() on the loaded entities. For…
user_update_7012 in modules/user/user.install
Add the user's pictures to the {file_managed} table and make them managed files.


includes/, line 536

function file_load_multiple($fids = array(), $conditions = array()) {
  return entity_load('file', $fids, $conditions);