Updated all the contrib modules to their latest versions.
[yaffs-website] / web / modules / contrib / entityqueue / src / EntityQueueHandlerInterface.php
1 <?php
2
3 namespace Drupal\entityqueue;
4
5 use Drupal\Component\Plugin\DerivativeInspectionInterface;
6 use Drupal\Component\Plugin\PluginInspectionInterface;
7 use Drupal\Core\Entity\EntityStorageInterface;
8 use Drupal\Core\Plugin\PluginFormInterface;
9 use Drupal\Component\Plugin\ConfigurablePluginInterface;
10
11 /**
12  * Provides an interface for an EntityQueueHandler plugin.
13  *
14  * @see \Drupal\entityqueue\Annotation\EntityQueueHandler
15  * @see \Drupal\entityqueue\EntityQueueHandlerManager
16  * @see \Drupal\entityqueue\EntityQueueHandlerBase
17  * @see plugin_api
18  */
19 interface EntityQueueHandlerInterface extends PluginFormInterface, ConfigurablePluginInterface, PluginInspectionInterface, DerivativeInspectionInterface {
20
21   /**
22    * Sets the entity queue that is using this plugin.
23    *
24    * @param \Drupal\entityqueue\EntityQueueInterface $queue
25    *   The entity queue.
26    *
27    * @return $this
28    */
29   public function setQueue(EntityQueueInterface $queue);
30
31   /**
32    * Whether or not the handler supports multiple subqueues.
33    *
34    * @return bool
35    */
36   public function supportsMultipleSubqueues();
37
38   /**
39    * Whether or not the handler contains subqueues with an automated lifecycle.
40    *
41    * For example, this property controls whether the title of subqueues can be
42    * edited, or if they can be created or deleted through the UI or API calls.
43    *
44    * @return bool
45    */
46   public function hasAutomatedSubqueues();
47
48   /**
49    * Gets this queue handler's list builder operations.
50    *
51    * @return array
52    *   An array of entity operations, as defined by
53    *   \Drupal\Core\Entity\EntityListBuilderInterface::getOperations()
54    */
55   public function getQueueListBuilderOperations();
56
57   /**
58    * Acts on an entity queue before the presave hook is invoked.
59    *
60    * @param \Drupal\entityqueue\EntityQueueInterface $queue
61    *   The entity queue object.
62    * @param \Drupal\Core\Entity\EntityStorageInterface $storage
63    *   The entity storage object.
64    */
65   public function onQueuePreSave(EntityQueueInterface $queue, EntityStorageInterface $storage);
66
67   /**
68    * Acts on an entity queue before the insert or update hook is invoked.
69    *
70    * @param \Drupal\entityqueue\EntityQueueInterface $queue
71    *   The entity queue object.
72    * @param \Drupal\Core\Entity\EntityStorageInterface $storage
73    *   The entity storage object.
74    * @param bool $update
75    *   TRUE if the queue has been updated, or FALSE if it has been inserted.
76    */
77   public function onQueuePostSave(EntityQueueInterface $queue, EntityStorageInterface $storage, $update = TRUE);
78
79   /**
80    * Acts on entity queues before they are deleted and before hooks are invoked.
81    *
82    * @param \Drupal\entityqueue\EntityQueueInterface $queue
83    *   The entity queue object.
84    * @param \Drupal\Core\Entity\EntityStorageInterface $storage
85    *   The entity storage object.
86    */
87   public function onQueuePreDelete(EntityQueueInterface $queue, EntityStorageInterface $storage);
88
89   /**
90    * Acts on deleted entity queues before the delete hook is invoked.
91    *
92    * @param \Drupal\entityqueue\EntityQueueInterface $queue
93    *   The entity queue object.
94    * @param \Drupal\Core\Entity\EntityStorageInterface $storage
95    *   The entity storage object.
96    */
97   public function onQueuePostDelete(EntityQueueInterface $queue, EntityStorageInterface $storage);
98
99   /**
100    * Acts on loaded entity queues.
101    *
102    * @param \Drupal\entityqueue\EntityQueueInterface $queue
103    *   The entity queue object.
104    * @param \Drupal\Core\Entity\EntityStorageInterface $storage
105    *   The entity storage object.
106    */
107   public function onQueuePostLoad(EntityQueueInterface $queue, EntityStorageInterface $storage);
108
109 }