3 namespace Drupal\entityqueue;
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;
12 * Provides an interface for an EntityQueueHandler plugin.
14 * @see \Drupal\entityqueue\Annotation\EntityQueueHandler
15 * @see \Drupal\entityqueue\EntityQueueHandlerManager
16 * @see \Drupal\entityqueue\EntityQueueHandlerBase
19 interface EntityQueueHandlerInterface extends PluginFormInterface, ConfigurablePluginInterface, PluginInspectionInterface, DerivativeInspectionInterface {
22 * Sets the entity queue that is using this plugin.
24 * @param \Drupal\entityqueue\EntityQueueInterface $queue
29 public function setQueue(EntityQueueInterface $queue);
32 * Whether or not the handler supports multiple subqueues.
36 public function supportsMultipleSubqueues();
39 * Whether or not the handler contains subqueues with an automated lifecycle.
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.
46 public function hasAutomatedSubqueues();
49 * Gets this queue handler's list builder operations.
52 * An array of entity operations, as defined by
53 * \Drupal\Core\Entity\EntityListBuilderInterface::getOperations()
55 public function getQueueListBuilderOperations();
58 * Acts on an entity queue before the presave hook is invoked.
60 * @param \Drupal\entityqueue\EntityQueueInterface $queue
61 * The entity queue object.
62 * @param \Drupal\Core\Entity\EntityStorageInterface $storage
63 * The entity storage object.
65 public function onQueuePreSave(EntityQueueInterface $queue, EntityStorageInterface $storage);
68 * Acts on an entity queue before the insert or update hook is invoked.
70 * @param \Drupal\entityqueue\EntityQueueInterface $queue
71 * The entity queue object.
72 * @param \Drupal\Core\Entity\EntityStorageInterface $storage
73 * The entity storage object.
75 * TRUE if the queue has been updated, or FALSE if it has been inserted.
77 public function onQueuePostSave(EntityQueueInterface $queue, EntityStorageInterface $storage, $update = TRUE);
80 * Acts on entity queues before they are deleted and before hooks are invoked.
82 * @param \Drupal\entityqueue\EntityQueueInterface $queue
83 * The entity queue object.
84 * @param \Drupal\Core\Entity\EntityStorageInterface $storage
85 * The entity storage object.
87 public function onQueuePreDelete(EntityQueueInterface $queue, EntityStorageInterface $storage);
90 * Acts on deleted entity queues before the delete hook is invoked.
92 * @param \Drupal\entityqueue\EntityQueueInterface $queue
93 * The entity queue object.
94 * @param \Drupal\Core\Entity\EntityStorageInterface $storage
95 * The entity storage object.
97 public function onQueuePostDelete(EntityQueueInterface $queue, EntityStorageInterface $storage);
100 * Acts on loaded entity queues.
102 * @param \Drupal\entityqueue\EntityQueueInterface $queue
103 * The entity queue object.
104 * @param \Drupal\Core\Entity\EntityStorageInterface $storage
105 * The entity storage object.
107 public function onQueuePostLoad(EntityQueueInterface $queue, EntityStorageInterface $storage);