SynonymsProviderPluginManager.php 905 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace Drupal\synonyms;
  3. use Drupal\Core\Cache\CacheBackendInterface;
  4. use Drupal\Core\Extension\ModuleHandlerInterface;
  5. use Drupal\Core\Plugin\DefaultPluginManager;
  6. use Drupal\synonyms\Annotation\SynonymsProvider;
  7. use Drupal\synonyms\SynonymsProviderInterface\SynonymsProviderInterface;
  8. /**
  9. * Plugin manager for Synonyms provider plugin type.
  10. */
  11. class SynonymsProviderPluginManager extends DefaultPluginManager {
  12. /**
  13. * {@inheritdoc}
  14. */
  15. public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
  16. parent::__construct(
  17. 'Plugin/Synonyms/Provider',
  18. $namespaces,
  19. $module_handler,
  20. SynonymsProviderInterface::class,
  21. SynonymsProvider::class
  22. );
  23. $this->alterInfo('synonyms_provider_info');
  24. $this->setCacheBackend($cache_backend, 'synonyms_provider_info_plugins');
  25. }
  26. }