3 namespace Drupal\views\Plugin;
5 use Drupal\Core\Cache\CacheBackendInterface;
6 use Drupal\Core\Extension\ModuleHandlerInterface;
7 use Drupal\Core\Plugin\DefaultPluginManager;
8 use Symfony\Component\DependencyInjection\Container;
11 * Plugin type manager for all views plugins.
13 * @ingroup views_plugins
15 class ViewsPluginManager extends DefaultPluginManager {
18 * Constructs a ViewsPluginManager object.
21 * The plugin type, for example filter.
22 * @param \Traversable $namespaces
23 * An object that implements \Traversable which contains the root paths
24 * keyed by the corresponding namespace to look for plugin implementations,
25 * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
26 * Cache backend instance to use.
27 * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
28 * The module handler to invoke the alter hook with.
30 public function __construct($type, \Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
31 $plugin_definition_annotation_name = 'Drupal\views\Annotation\Views' . Container::camelize($type);
32 parent::__construct("Plugin/views/$type", $namespaces, $module_handler, 'Drupal\views\Plugin\views\ViewsPluginInterface', $plugin_definition_annotation_name);
36 'plugin_type' => $type,
37 'register_theme' => TRUE,
40 $this->alterInfo('views_plugins_' . $type);
41 $this->setCacheBackend($cache_backend, "views:$type");