DerivativeDiscoveryDecorator
class DerivativeDiscoveryDecorator implements DiscoveryInterface (View source)
Base class providing the tools for a plugin discovery to be derivative aware.
Provides a decorator that allows the use of plugin derivatives for normal implementations DiscoveryInterface.
Traits
Properties
| protected DeriverInterface[] | $derivers | Plugin derivers. |
|
| protected DiscoveryInterface | $decorated | The decorated plugin discovery. |
Methods
Gets the definition of all plugins for this type.
Gets a specific plugin definition.
Gets a specific plugin definition.
Adds derivatives to a list of plugin definitions.
Decodes derivative id and plugin id from a string.
Encodes plugin and derivative id's into a string.
Gets a deriver for a base plugin.
Gets the deriver class name from the base plugin definition.
Merges a base and derivative definition, taking into account empty values.
Passes through all unknown calls onto the decorated object.
Details
array
getDefinitions()
Gets the definition of all plugins for this type.
mixed
getDefinition(string $plugin_id, bool $exception_on_invalid = TRUE)
Gets a specific plugin definition.
protected array|null
doGetDefinition(array $definitions, string $plugin_id, bool $exception_on_invalid)
Gets a specific plugin definition.
hasDefinition($plugin_id)
{@inheritdoc}
__construct(DiscoveryInterface $decorated)
Creates a new instance.
protected
getDerivatives(array $base_plugin_definitions)
Adds derivatives to a list of plugin definitions.
This should be called by the class extending this in DiscoveryInterface::getDefinitions().
protected array
decodePluginId(string $plugin_id)
Decodes derivative id and plugin id from a string.
protected string
encodePluginId(string $base_plugin_id, string $derivative_id)
Encodes plugin and derivative id's into a string.
protected DeriverInterface|null
getDeriver(string $base_plugin_id, mixed $base_definition)
Gets a deriver for a base plugin.
protected string|null
getDeriverClass(array $base_definition)
Gets the deriver class name from the base plugin definition.
protected array
mergeDerivativeDefinition(array $base_plugin_definition, array $derivative_definition)
Merges a base and derivative definition, taking into account empty values.
__call($method, $args)
Passes through all unknown calls onto the decorated object.