Pathologic was missing because of a .git folder inside.
[yaffs-website] / web / modules / contrib / entityqueue / src / EntityQueueHandlerPluginCollection.php
1 <?php
2
3 namespace Drupal\entityqueue;
4
5 use Drupal\Component\Plugin\PluginManagerInterface;
6 use Drupal\Core\Plugin\DefaultSingleLazyPluginCollection;
7
8 /**
9  * Provides a container for lazily loading EntityQueueHandler plugins.
10  */
11 class EntityQueueHandlerPluginCollection extends DefaultSingleLazyPluginCollection {
12
13   /**
14    * The entity queue that is using this plugin collection.
15    *
16    * @var \Drupal\entityqueue\Entity\EntityQueue
17    */
18   protected $queue;
19
20   /**
21    * Constructs a new EntityQueueHandlerPluginCollection.
22    *
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.
31    */
32   public function __construct(PluginManagerInterface $manager, $instance_id, array $configuration, EntityQueueInterface $queue) {
33     parent::__construct($manager, $instance_id, $configuration);
34
35     $this->queue = $queue;
36   }
37
38   /**
39    * {@inheritdoc}
40    *
41    * @return \Drupal\entityqueue\EntityQueueHandlerInterface
42    */
43   public function &get($instance_id) {
44     return parent::get($instance_id);
45   }
46
47   /**
48    * {@inheritdoc}
49    */
50   protected function initializePlugin($instance_id) {
51     parent::initializePlugin($instance_id);
52
53     $this->pluginInstances[$instance_id]->setQueue($this->queue);
54   }
55
56   /**
57    * {@inheritdoc}
58    */
59   public function addInstanceId($id, $configuration = NULL) {
60     // @todo Open a core bug report, the parent class should take care of this..
61     $this->instanceId = $id;
62     $this->instanceIDs = array_filter($this->instanceIDs);
63
64     parent::addInstanceId($id, $configuration);
65   }
66
67 }