3 namespace Drupal\workflows;
5 use Drupal\Core\Cache\CacheBackendInterface;
6 use Drupal\Core\Extension\ModuleHandlerInterface;
7 use Drupal\Core\Plugin\DefaultPluginManager;
8 use Drupal\workflows\Annotation\WorkflowType;
11 * Provides a Workflow type plugin manager.
13 * @see \Drupal\workflows\Annotation\WorkflowType
14 * @see \Drupal\workflows\WorkflowTypeInterface
18 * The workflow system is currently experimental and should only be leveraged
19 * by experimental modules and development releases of contributed modules.
21 class WorkflowTypeManager extends DefaultPluginManager {
24 * Constructs a new class instance.
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.
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');