function FileRepository::__construct

Same name and namespace in other branches
  1. 10 core/modules/file/src/FileRepository.php \Drupal\file\FileRepository::__construct()
  2. 11.x core/modules/file/src/FileRepository.php \Drupal\file\FileRepository::__construct()

FileRepository constructor.

Parameters

\Drupal\Core\File\FileSystemInterface $fileSystem: The file system.

\Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $streamWrapperManager: The stream wrapper manager.

\Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager: The entity type manager.

\Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler: The module handler.

\Drupal\file\FileUsage\FileUsageInterface $fileUsage: The file usage service.

\Drupal\Core\Session\AccountInterface $currentUser: The current user.

File

core/modules/file/src/FileRepository.php, line 77

Class

FileRepository
Provides a file entity repository.

Namespace

Drupal\file

Code

public function __construct(FileSystemInterface $fileSystem, StreamWrapperManagerInterface $streamWrapperManager, EntityTypeManagerInterface $entityTypeManager, ModuleHandlerInterface $moduleHandler, FileUsageInterface $fileUsage, AccountInterface $currentUser) {
    $this->fileSystem = $fileSystem;
    $this->streamWrapperManager = $streamWrapperManager;
    $this->entityTypeManager = $entityTypeManager;
    $this->moduleHandler = $moduleHandler;
    $this->fileUsage = $fileUsage;
    $this->currentUser = $currentUser;
}

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