abstract class PluginBag

Defines an object which stores multiple plugin instances to lazy load them.

The \ArrayAccess implementation is only for backwards compatibility, it is deprecated and should not be used by new code.

Hierarchy

  • class \Drupal\Component\Plugin\PluginBag implements \Drupal\Component\Plugin\Iterator, \Drupal\Component\Plugin\Countable

Expanded class hierarchy of PluginBag

6 files declare their use of PluginBag

File

drupal/core/lib/Drupal/Component/Plugin/PluginBag.php, line 16
Contains \Drupal\Component\Plugin\PluginBag.

Namespace

Drupal\Component\Plugin
View source

Members

Namesort descending Modifiers Type Description Overrides
PluginBag::$instanceIDs protected property Stores the IDs of all potential plugin instances.
PluginBag::$pluginInstances protected property Stores all instantiated plugins.
PluginBag::addInstanceID public function Adds an instance ID to the array of available instance IDs.
PluginBag::clear public function Clears all instantiated plugins. 1
PluginBag::count public function Implements \Countable::count().
PluginBag::current public function Implements \Iterator::current().
PluginBag::get public function Retrieves a plugin instance, initializing it if necessary.
PluginBag::getInstanceIDs public function Returns all instance IDs.
PluginBag::has public function Determines if a plugin instance exists.
PluginBag::initializePlugin abstract protected function Initializes a plugin and stores the result in $this->pluginInstances. 6
PluginBag::key public function Implements \Iterator::key().
PluginBag::next public function Implements \Iterator::next().
PluginBag::remove public function Removes an initialized plugin. 1
PluginBag::rewind public function Implements \Iterator::rewind().
PluginBag::set public function Stores an initialized plugin.
PluginBag::setInstanceIDs public function Sets the instance IDs property.
PluginBag::valid public function Implements \Iterator::valid().