public function FileUploadForm::__construct in Drupal 8
Same name and namespace in other branches
- 9 core/modules/media_library/src/Form/FileUploadForm.php \Drupal\media_library\Form\FileUploadForm::__construct()
Constructs a new FileUploadForm.
Parameters
\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.
\Drupal\media_library\MediaLibraryUiBuilder $library_ui_builder: The media library UI builder.
\Drupal\Core\Render\ElementInfoManagerInterface $element_info: The element info manager.
\Drupal\Core\Render\RendererInterface $renderer: The renderer service.
\Drupal\Core\File\FileSystemInterface $file_system: The file system service.
\Drupal\media_library\OpenerResolverInterface $opener_resolver: The opener resolver.
\Drupal\file\FileUsage\FileUsageInterface $file_usage: The file usage service.
Overrides AddFormBase::__construct
File
- core/
modules/ media_library/ src/ Form/ FileUploadForm.php, line 80
Class
- FileUploadForm
- Creates a form to create media entities from uploaded files.
Namespace
Drupal\media_library\FormCode
public function __construct(EntityTypeManagerInterface $entity_type_manager, MediaLibraryUiBuilder $library_ui_builder, ElementInfoManagerInterface $element_info, RendererInterface $renderer, FileSystemInterface $file_system, OpenerResolverInterface $opener_resolver = NULL, FileUsageInterface $file_usage = NULL) {
parent::__construct($entity_type_manager, $library_ui_builder, $opener_resolver);
$this->elementInfo = $element_info;
$this->renderer = $renderer;
$this->fileSystem = $file_system;
if (!$file_usage) {
@trigger_error('Calling FileUploadForm::__construct() without the `file.usage` service is deprecated in drupal:8.8.0 and is removed in drupal:9.0.0. Pass the `file.usage` service to the constructor. See https://www.drupal.org/node/3075165', E_USER_DEPRECATED);
$file_usage = \Drupal::service('file.usage');
}
$this->fileUsage = $file_usage;
}