function ViewsHandlerManager::__construct

Same name in other branches
  1. 9 core/modules/views/src/Plugin/ViewsHandlerManager.php \Drupal\views\Plugin\ViewsHandlerManager::__construct()
  2. 10 core/modules/views/src/Plugin/ViewsHandlerManager.php \Drupal\views\Plugin\ViewsHandlerManager::__construct()
  3. 11.x core/modules/views/src/Plugin/ViewsHandlerManager.php \Drupal\views\Plugin\ViewsHandlerManager::__construct()

Constructs a ViewsHandlerManager object.

Parameters

string $handler_type: The plugin type, for example filter.

\Traversable $namespaces: An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations,

\Drupal\views\ViewsData $views_data: The views data cache.

\Drupal\Core\Cache\CacheBackendInterface $cache_backend: Cache backend instance to use.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler to invoke the alter hook with.

Overrides DefaultPluginManager::__construct

File

core/modules/views/src/Plugin/ViewsHandlerManager.php, line 49

Class

ViewsHandlerManager
Plugin type manager for all views handlers.

Namespace

Drupal\views\Plugin

Code

public function __construct($handler_type, \Traversable $namespaces, ViewsData $views_data, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
    $plugin_definition_annotation_name = 'Drupal\\views\\Annotation\\Views' . Container::camelize($handler_type);
    $plugin_interface = 'Drupal\\views\\Plugin\\views\\ViewsHandlerInterface';
    if ($handler_type == 'join') {
        $plugin_interface = 'Drupal\\views\\Plugin\\views\\join\\JoinPluginInterface';
    }
    parent::__construct("Plugin/views/{$handler_type}", $namespaces, $module_handler, $plugin_interface, $plugin_definition_annotation_name);
    $this->setCacheBackend($cache_backend, "views:{$handler_type}");
    $this->alterInfo('views_plugins_' . $handler_type);
    $this->viewsData = $views_data;
    $this->handlerType = $handler_type;
    $this->defaults = [
        'plugin_type' => $handler_type,
    ];
}

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