class IntegrationManager extends DefaultPluginManager

A plugin manager for bankid plugins.

The IntegrationManager class extends the DefaultPluginManager to provide a way to manage bankid plugins. A plugin manager defines a new plugin type and how instances of any plugin of that type will be discovered, instantiated and more.

Using the DefaultPluginManager as a starting point sets up our bankid plugin type to use annotated discovery.

The plugin manager is also declared as a service in bankid.services.yml so that it can be easily accessed and used anytime we need to work with bankid plugins.

Methods

__construct(Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler)

Constructs a new \Drupal\bankid\IntegrationManager object.

createInstance(string $plugin_id, array $configuration = [])

Create an instance of a integration plugin.

Details

at line 38
__construct(Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler)

Constructs a new \Drupal\bankid\IntegrationManager object.

Parameters

Traversable $namespaces

An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations.

CacheBackendInterface $cache_backend

Cache backend instance to use.

ModuleHandlerInterface $module_handler

The module handler to invoke the alter hook with.

at line 64
IntegrationInterface createInstance(string $plugin_id, array $configuration = [])

Create an instance of a integration plugin.

Parameters

string $plugin_id

The ID of the plugin being instantiated.

array $configuration

An array of configuration relevant to the plugin instance.

Return Value

IntegrationInterface

A fully configured plugin instance.

Exceptions

PluginException