Updated all the contrib modules to their latest versions.
[yaffs-website] / web / modules / contrib / eu_cookie_compliance / src / Plugin / ConsentStorageManager.php
1 <?php
2
3 namespace Drupal\eu_cookie_compliance\Plugin;
4
5 use Drupal\Core\Cache\CacheBackendInterface;
6 use Drupal\Core\Extension\ModuleHandlerInterface;
7 use Drupal\Core\Plugin\DefaultPluginManager;
8 use Drupal\Component\Plugin\FallbackPluginManagerInterface;
9
10 /**
11  * Provides an ConsentStorage plugin manager.
12  *
13  * @see \Drupal\eu_cookie_compliance\Annotation\ConsentStorage
14  * @see \Drupal\eu_cookie_compliance\Plugin\ConsentStorageInterface
15  * @see plugin_api
16  */
17 class ConsentStorageManager extends DefaultPluginManager implements FallbackPluginManagerInterface {
18
19   /**
20    * Constructs a ConsentStorageManager object.
21    *
22    * @param \Traversable $namespaces
23    *   An object that implements \Traversable which contains the root paths
24    *   keyed by the corresponding namespace to look for plugin implementations.
25    * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
26    *   Cache backend instance to use.
27    * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
28    *   The module handler to invoke the alter hook with.
29    */
30   public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
31     parent::__construct(
32       'Plugin/ConsentStorage',
33       $namespaces,
34       $module_handler,
35       'Drupal\eu_cookie_compliance\Plugin\ConsentStorageInterface',
36       'Drupal\eu_cookie_compliance\Annotation\ConsentStorage'
37     );
38     $this->alterInfo('consent_storage_info');
39     $this->setCacheBackend($cache_backend, 'consent_storage_info_plugins');
40   }
41
42   /**
43    * {@inheritdoc}
44    */
45   public function getFallbackPluginId($plugin_id, array $configuration = []) {
46     return 'basic';
47   }
48
49 }