You are here

public function File::__construct in Helper 8

File constructor.

Parameters

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

\Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface $mime_type_guesser: The mime type guesser.

File

src/File.php, line 37

Class

File
Provides helpers for working with files.

Namespace

Drupal\helper

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, MimeTypeGuesserInterface $mime_type_guesser) {
  $this->fileStorage = $entity_type_manager
    ->getStorage('file');
  $this->mimeTypeGuesser = $mime_type_guesser;
}