W3cubDocs

/Drupal 8

function file_load_multiple

file_load_multiple(array $fids = NULL, $reset = FALSE)

Loads file entities from the database.

Parameters

array|null $fids: (optional) An array of entity IDs. If omitted or NULL, all entities are loaded.

bool $reset: (optional) Whether to reset the internal file_load_multiple() cache. Defaults to FALSE.

Return value

array An array of file entities, indexed by fid.

Deprecated

in Drupal 8.x, will be removed before Drupal 9.0. Use \Drupal\file\Entity\File::loadMultiple().

See also

hook_ENTITY_TYPE_load()

file_load()

entity_load()

\Drupal\Core\Entity\Query\EntityQueryInterface

File

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

Code

function file_load_multiple(array $fids = NULL, $reset = FALSE) {
  if ($reset) {
    \Drupal::entityManager()->getStorage('file')->resetCache($fids);
  }
  return File::loadMultiple($fids);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!file!file.module/function/file_load_multiple/8.1.x