function ViewsHandlerManager::__construct
Same name in other branches
- 9 core/modules/views/src/Plugin/ViewsHandlerManager.php \Drupal\views\Plugin\ViewsHandlerManager::__construct()
- 8.9.x core/modules/views/src/Plugin/ViewsHandlerManager.php \Drupal\views\Plugin\ViewsHandlerManager::__construct()
- 10 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 51
Class
- ViewsHandlerManager
- Plugin type manager for all views handlers.
Namespace
Drupal\views\PluginCode
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);
// Special handling until all views plugins have attribute classes.
$attribute_name_candidate = 'Drupal\\views\\Attribute\\Views' . Container::camelize($handler_type);
$plugin_definition_attribute_name = class_exists($attribute_name_candidate) ? $attribute_name_candidate : Plugin::class;
$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_attribute_name, $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.