LazyPluginCollection
abstract class LazyPluginCollection implements IteratorAggregate, Countable (View source)
Defines an object which stores multiple plugin instances to lazy load them.
Properties
| protected array | $pluginInstances | Stores all instantiated plugins. |
|
| protected array | $instanceIds | Stores the IDs of all potential plugin instances. |
Methods
Initializes and stores a plugin.
Gets the current configuration of all plugins in this collection.
Sets the configuration for all plugins in this collection.
Clears all instantiated plugins.
Determines if a plugin instance exists.
Gets a plugin instance, initializing it if necessary.
Stores an initialized plugin.
Removes an initialized plugin.
Adds an instance ID to the available instance IDs.
Gets all instance IDs.
Removes an instance ID.
No description
{@inheritdoc}
Details
abstract protected
initializePlugin(string $instance_id)
Initializes and stores a plugin.
abstract array
getConfiguration()
Gets the current configuration of all plugins in this collection.
abstract $this
setConfiguration(array $configuration)
Sets the configuration for all plugins in this collection.
clear()
Clears all instantiated plugins.
bool
has(string $instance_id)
Determines if a plugin instance exists.
get(string $instance_id)
Gets a plugin instance, initializing it if necessary.
set(string $instance_id, mixed $value)
Stores an initialized plugin.
remove(string $instance_id)
Removes an initialized plugin.
The plugin can still be used; it will be reinitialized.
addInstanceId(string $id, array|null $configuration = NULL)
Adds an instance ID to the available instance IDs.
array
getInstanceIds()
Gets all instance IDs.
removeInstanceId(string $instance_id)
Removes an instance ID.
getIterator()
No description
count()
{@inheritdoc}