function AddFormBase::__construct

Same name and namespace in other branches
  1. 11.x core/modules/media_library/src/Form/AddFormBase.php \Drupal\media_library\Form\AddFormBase::__construct()
  2. 10 core/modules/media_library/src/Form/AddFormBase.php \Drupal\media_library\Form\AddFormBase::__construct()
  3. 9 core/modules/media_library/src/Form/AddFormBase.php \Drupal\media_library\Form\AddFormBase::__construct()
  4. 8.9.x core/modules/media_library/src/Form/AddFormBase.php \Drupal\media_library\Form\AddFormBase::__construct()

Constructs an AddFormBase object.

Parameters

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

\Drupal\media_library\MediaLibraryUiBuilder $libraryUiBuilder: The media library UI builder.

\Drupal\media_library\OpenerResolverInterface $openerResolver: The opener resolver.

2 calls to AddFormBase::__construct()
FileUploadForm::__construct in core/modules/media_library/src/Form/FileUploadForm.php
Constructs a new FileUploadForm.
OEmbedForm::__construct in core/modules/media_library/src/Form/OEmbedForm.php
Constructs a new OEmbedForm.
2 methods override AddFormBase::__construct()
FileUploadForm::__construct in core/modules/media_library/src/Form/FileUploadForm.php
Constructs a new FileUploadForm.
OEmbedForm::__construct in core/modules/media_library/src/Form/OEmbedForm.php
Constructs a new OEmbedForm.

File

core/modules/media_library/src/Form/AddFormBase.php, line 57

Class

AddFormBase
Provides a base class for creating media items from within the media library.

Namespace

Drupal\media_library\Form

Code

public function __construct(protected EntityTypeManagerInterface $entityTypeManager, protected MediaLibraryUiBuilder $libraryUiBuilder, protected OpenerResolverInterface $openerResolver) {
  $this->viewBuilder = $this->entityTypeManager
    ->getViewBuilder('media');
}

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