public function MediaService::__construct in Gutenberg 8
Same name and namespace in other branches
- 8.2 src/Service/MediaService.php \Drupal\gutenberg\Service\MediaService::__construct()
MediaController constructor.
Parameters
\Drupal\gutenberg\MediaTypeGuesserInterface $media_type_guesser: The media type guesser.
\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.
\Drupal\gutenberg\Persistence\MediaTypePersistenceManager $media_type_persistence_manager: The media type persistence manager.
\Drupal\gutenberg\DataProvider\EntityDataProviderManager $entity_data_provider_manager: The entity data provider manager.
\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.
\Drupal\gutenberg\MediaUploaderInterface $media_uploader: The media uploader.
\Drupal\Core\Render\RendererInterface $renderer: The renderer.
\Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info: The entity type bundle service.
\Drupal\gutenberg\MediaEntityRendererInterface $media_entity_renderer: The media entity renderer.
\Drupal\Core\Database\Connection $connection: The database connection.
\Drupal\Core\Entity\EntityDisplayRepositoryInterface $entity_display_repository: The entity display repository.
File
- src/
Service/ MediaService.php, line 138
Class
- MediaService
- The media service class.
Namespace
Drupal\gutenberg\ServiceCode
public function __construct(MediaTypeGuesserInterface $media_type_guesser, EntityTypeManagerInterface $entity_type_manager, MediaTypePersistenceManager $media_type_persistence_manager, EntityDataProviderManager $entity_data_provider_manager, ModuleHandlerInterface $module_handler, MediaUploaderInterface $media_uploader, RendererInterface $renderer, EntityTypeBundleInfoInterface $entity_type_bundle_info, MediaEntityRendererInterface $media_entity_renderer, Connection $connection, EntityDisplayRepositoryInterface $entity_display_repository) {
$this->mediaTypeGuesser = $media_type_guesser;
$this->entityTypeManager = $entity_type_manager;
$this->mediaTypePersisterManager = $media_type_persistence_manager;
$this->entityDataProviderManager = $entity_data_provider_manager;
$this->moduleHandler = $module_handler;
$this->mediaUploader = $media_uploader;
$this->renderer = $renderer;
$this->entityTypeBundleInfo = $entity_type_bundle_info;
$this->mediaEntityRenderer = $media_entity_renderer;
$this->connection = $connection;
$this->entityDisplayRepository = $entity_display_repository;
if ($this->moduleHandler
->moduleExists('media_library')) {
$this->builder = \Drupal::getContainer()
->get('gutenberg.media_library.ui_builder');
}
}