1 {% extends "base/class.php.twig" %}
4 \Drupal\{{ module }}\Plugin\{{ class_name }}Manager.
7 {% block namespace_class %}
8 namespace Drupal\{{ module }}\Plugin;
12 use Drupal\Core\Plugin\DefaultPluginManager;
13 use Drupal\Core\Cache\CacheBackendInterface;
14 use Drupal\Core\Extension\ModuleHandlerInterface;
17 {% block class_declaration %}
19 * Provides the {{ label }} plugin manager.
21 class {{ class_name }}Manager extends DefaultPluginManager {% endblock %}
22 {% block class_methods %}
25 * Constructs a new {{ class_name }}Manager object.
27 * @param \Traversable $namespaces
28 * An object that implements \Traversable which contains the root paths
29 * keyed by the corresponding namespace to look for plugin implementations.
30 * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
31 * Cache backend instance to use.
32 * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
33 * The module handler to invoke the alter hook with.
35 public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
36 parent::__construct('Plugin/{{ class_name }}', $namespaces, $module_handler, 'Drupal\{{ module }}\Plugin\{{ class_name }}Interface', 'Drupal\{{ module }}\Annotation\{{ class_name }}');
38 $this->alterInfo('{{ module }}_{{ machine_name }}_info');
39 $this->setCacheBackend($cache_backend, '{{ module }}_{{ machine_name }}_plugins');