AudioFieldPlayerManager.php 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Drupal\audiofield;
  3. use Drupal\Core\Plugin\DefaultPluginManager;
  4. use Drupal\Core\Cache\CacheBackendInterface;
  5. use Drupal\Core\Extension\ModuleHandlerInterface;
  6. /**
  7. * Manages audio player plugins.
  8. */
  9. class AudioFieldPlayerManager extends DefaultPluginManager {
  10. /**
  11. * Constructs a new AudioFieldPlayerManager.
  12. *
  13. * @param \Traversable $namespaces
  14. * An object that implements \Traversable which contains the root paths
  15. * keyed by the corresponding namespace to look for plugin implementations.
  16. * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
  17. * Cache backend instance to use.
  18. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  19. * The module handler.
  20. */
  21. public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
  22. parent::__construct('Plugin/AudioPlayer', $namespaces, $module_handler, 'Drupal\audiofield\AudioFieldPluginBase', 'Drupal\audiofield\Annotation\AudioPlayer');
  23. $this->alterInfo('audiofield');
  24. $this->setCacheBackend($cache_backend, 'audiofield_audioplayer');
  25. }
  26. }