Version 1
[yaffs-website] / web / core / modules / workflows / src / WorkflowTypeManager.php
1 <?php
2
3 namespace Drupal\workflows;
4
5 use Drupal\Core\Cache\CacheBackendInterface;
6 use Drupal\Core\Extension\ModuleHandlerInterface;
7 use Drupal\Core\Plugin\DefaultPluginManager;
8 use Drupal\workflows\Annotation\WorkflowType;
9
10 /**
11  * Provides a Workflow type plugin manager.
12  *
13  * @see \Drupal\workflows\Annotation\WorkflowType
14  * @see \Drupal\workflows\WorkflowTypeInterface
15  * @see plugin_api
16  *
17  * @internal
18  *   The workflow system is currently experimental and should only be leveraged
19  *   by experimental modules and development releases of contributed modules.
20  */
21 class WorkflowTypeManager extends DefaultPluginManager {
22
23   /**
24    * Constructs a new class instance.
25    *
26    * @param \Traversable $namespaces
27    *   An object that implements \Traversable which contains the root paths
28    *   keyed by the corresponding namespace to look for plugin implementations.
29    * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
30    *   Cache backend instance to use.
31    * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
32    *   The module handler to invoke the alter hook with.
33    */
34   public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
35     parent::__construct('Plugin/WorkflowType', $namespaces, $module_handler, WorkflowTypeInterface::class, WorkflowType::class);
36     $this->alterInfo('workflow_type_info');
37     $this->setCacheBackend($cache_backend, 'workflow_type_info');
38   }
39
40 }