function ManagedFile::fileUsage

Same name and namespace in other branches
  1. 9 core/modules/file/src/Element/ManagedFile.php \Drupal\file\Element\ManagedFile::fileUsage()
  2. 10 core/modules/file/src/Element/ManagedFile.php \Drupal\file\Element\ManagedFile::fileUsage()
  3. 11.x core/modules/file/src/Element/ManagedFile.php \Drupal\file\Element\ManagedFile::fileUsage()

Wraps the file usage service.

Return value

\Drupal\file\FileUsage\FileUsageInterface

File

core/modules/file/src/Element/ManagedFile.php, line 467

Class

ManagedFile
Provides an AJAX/progress aware widget for uploading and saving a file.

Namespace

Drupal\file\Element

Code

protected static function fileUsage() {
    return \Drupal::service('file.usage');
}

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