3 namespace Drupal\entityqueue;
5 use Drupal\Component\Plugin\PluginManagerInterface;
6 use Drupal\Core\Plugin\DefaultSingleLazyPluginCollection;
9 * Provides a container for lazily loading EntityQueueHandler plugins.
11 class EntityQueueHandlerPluginCollection extends DefaultSingleLazyPluginCollection {
14 * The entity queue that is using this plugin collection.
16 * @var \Drupal\entityqueue\Entity\EntityQueue
21 * Constructs a new EntityQueueHandlerPluginCollection.
23 * @param \Drupal\Component\Plugin\PluginManagerInterface $manager
24 * The manager to be used for instantiating plugins.
25 * @param string $instance_id
26 * The ID of the plugin instance.
27 * @param array $configuration
28 * An array of configuration.
29 * @param \Drupal\entityqueue\EntityQueueInterface $queue
30 * The entity queue using this plugin.
32 public function __construct(PluginManagerInterface $manager, $instance_id, array $configuration, EntityQueueInterface $queue) {
33 $this->queue = $queue;
35 parent::__construct($manager, $instance_id, $configuration);
41 * @return \Drupal\entityqueue\EntityQueueHandlerInterface
43 public function &get($instance_id) {
44 return parent::get($instance_id);
50 protected function initializePlugin($instance_id) {
51 parent::initializePlugin($instance_id);
53 $this->pluginInstances[$instance_id]->setQueue($this->queue);