file_load_multiple

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

Loads file objects from the database.

@todo Remove $conditions in Drupal 8.

Parameters

$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

hook_file_load()

file_load()

entity_load()

EntityFieldQuery

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/file.inc
Copies a file to a new location and adds a file record to the database.
file_field_load in modules/file/file.field.inc
Implements hook_field_load().
file_file_download in modules/file/file.module
Implements hook_file_download().
file_load in includes/file.inc
Load a file object from the database.
file_move in includes/file.inc
Move a file to a new location and update the file's database entry.
file_save_data in includes/file.inc
Save a string to the specified destination and create a database file entry.
file_save_upload in includes/file.inc
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.

Code

includes/file.inc, line 536

<?php
function file_load_multiple($fids = array(), $conditions = array()) {
  return entity_load('file', $fids, $conditions);
}
?>