b60462f3a97edb949ca5327506bea104cc257325
[yaffs-website] / Plugin / RelationshipManager.php
1 <?php
2
3 namespace Drupal\ctools\Plugin;
4
5 use Drupal\Core\Plugin\Context\ContextAwarePluginManagerTrait;
6 use Drupal\Core\Plugin\DefaultPluginManager;
7 use Drupal\Core\Cache\CacheBackendInterface;
8 use Drupal\Core\Extension\ModuleHandlerInterface;
9
10 /**
11  * Provides the Relationship plugin manager.
12  */
13 class RelationshipManager extends DefaultPluginManager implements RelationshipManagerInterface {
14
15   use ContextAwarePluginManagerTrait;
16
17   /**
18    * Constructor for RelationshipManager objects.
19    *
20    * @param \Traversable $namespaces
21    *   An object that implements \Traversable which contains the root paths
22    *   keyed by the corresponding namespace to look for plugin implementations.
23    * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
24    *   Cache backend instance to use.
25    * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
26    *   The module handler to invoke the alter hook with.
27    */
28   public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
29     parent::__construct('Plugin/Relationship', $namespaces, $module_handler, 'Drupal\ctools\Plugin\RelationshipInterface', 'Drupal\ctools\Annotation\Relationship');
30
31     $this->alterInfo('ctools_relationship_info');
32     $this->setCacheBackend($cache_backend, 'ctools_relationship_plugins');
33   }
34
35 }