You are here

public function DirectoryBrowser::__construct in Media Directories 2.x

Same name and namespace in other branches
  1. 8 modules/media_directories_ui/src/Plugin/EntityBrowser/Widget/DirectoryBrowser.php \Drupal\media_directories_ui\Plugin\EntityBrowser\Widget\DirectoryBrowser::__construct()
  2. 3.x modules/media_directories_ui/src/Plugin/EntityBrowser/Widget/DirectoryBrowser.php \Drupal\media_directories_ui\Plugin\EntityBrowser\Widget\DirectoryBrowser::__construct()

Constructs a new View object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher: Event dispatcher service.

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

\Drupal\entity_browser\WidgetValidationManager $validation_manager: The Widget Validation Manager service.

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

\Drupal\Core\Routing\RouteMatchInterface $route_match: The active route match object.

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

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.

File

modules/media_directories_ui/src/Plugin/EntityBrowser/Widget/DirectoryBrowser.php, line 112

Class

DirectoryBrowser
Uses a view to provide entity listing in a browser's widget.

Namespace

Drupal\media_directories_ui\Plugin\EntityBrowser\Widget

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, EventDispatcherInterface $event_dispatcher, EntityTypeManagerInterface $entity_type_manager, WidgetValidationManager $validation_manager, AccountInterface $current_user, RouteMatchInterface $route_match, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $event_dispatcher, $entity_type_manager, $validation_manager);
  $this->currentUser = $current_user;
  $this->routeMatch = $route_match;
  $this->moduleHandler = $module_handler;
  $config = $config_factory
    ->get('media_directories.settings');
  $this->vocabularyId = $config
    ->get('directory_taxonomy');
}