function FileAccessControlHandler::getFileReferences

Same name in other branches
  1. 9 core/modules/file/src/FileAccessControlHandler.php \Drupal\file\FileAccessControlHandler::getFileReferences()
  2. 8.9.x core/modules/file/src/FileAccessControlHandler.php \Drupal\file\FileAccessControlHandler::getFileReferences()
  3. 10 core/modules/file/src/FileAccessControlHandler.php \Drupal\file\FileAccessControlHandler::getFileReferences()

Wrapper for file_get_file_references().

Parameters

\Drupal\file\FileInterface $file: The file object for which to get references.

Return value

array A multidimensional array. The keys are field_name, entity_type, entity_id and the value is an entity referencing this file.

See also

file_get_file_references()

1 call to FileAccessControlHandler::getFileReferences()
FileAccessControlHandler::checkAccess in core/modules/file/src/FileAccessControlHandler.php
Performs access checks.

File

core/modules/file/src/FileAccessControlHandler.php, line 96

Class

FileAccessControlHandler
Provides a File access control handler.

Namespace

Drupal\file

Code

protected function getFileReferences(FileInterface $file) {
    return file_get_file_references($file, NULL, EntityStorageInterface::FIELD_LOAD_REVISION, NULL);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.