file_load($fid,$reset= FALSE)
Loads a single file entity from the database.
int $fid: A file ID.
bool $reset: (optional) Whether to reset the internal file_load_multiple() cache. Defaults to FALSE.
\Drupal\file\FileInterface|null A file entity or NULL if the file was not found.
in Drupal 8.x, will be removed before Drupal 9.0. Use \Drupal\file\Entity\File::load().
function file_load($fid, $reset = FALSE) { if ($reset) { \Drupal::entityManager()->getStorage('file')->resetCache(array($fid)); } return File::load($fid); }
© 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/8.1.x