3 namespace Drupal\{{ machine_name }};
5 use Drupal\Core\Cache\CacheBackendInterface;
6 use Drupal\Core\Extension\ModuleHandlerInterface;
7 use Drupal\Core\Plugin\DefaultPluginManager;
10 * {{ name }} plugin manager.
12 class {{ class_prefix }}PluginManager extends DefaultPluginManager {
15 * Constructs {{ class_prefix }}PluginManager object.
17 * @param \Traversable $namespaces
18 * An object that implements \Traversable which contains the root paths
19 * keyed by the corresponding namespace to look for plugin implementations.
20 * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
21 * Cache backend instance to use.
22 * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
23 * The module handler to invoke the alter hook with.
25 public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
27 'Plugin/{{ class_prefix }}',
30 'Drupal\{{ machine_name }}\{{ class_prefix }}Interface',
31 'Drupal\{{ machine_name }}\Annotation\{{ class_prefix }}'
33 $this->alterInfo('{{ machine_name }}_info');
34 $this->setCacheBackend($cache_backend, '{{ machine_name }}_info');