You are here

function file_load_multiple in Drupal 7

Same name and namespace in other branches
  1. 8 core/modules/file/file.module \file_load_multiple()

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

15 calls to 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.
FilePrivateTestCase::testPrivateFile in modules/file/tests/file.test
Tests file access for file uploaded to a private node.
FileSaveUploadTest::testNormal in modules/simpletest/tests/file.test
Test the file_save_upload() function.

... See full list

File

includes/file.inc, line 580
API for handling file uploads and server file management.

Code

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