3 namespace Drupal\entityqueue;
5 use Drupal\Core\Entity\EntityStorageInterface;
6 use Drupal\Core\Plugin\PluginFormInterface;
7 use Drupal\Component\Plugin\ConfigurablePluginInterface;
10 * Provides an interface for an EntityQueueHandler plugin.
12 * @see \Drupal\entityqueue\Annotation\EntityQueueHandler
13 * @see \Drupal\entityqueue\EntityQueueHandlerManager
14 * @see \Drupal\entityqueue\EntityQueueHandlerBase
17 interface EntityQueueHandlerInterface extends PluginFormInterface, ConfigurablePluginInterface {
20 * Sets the entity queue that is using this plugin.
22 * @param \Drupal\entityqueue\EntityQueueInterface $queue
27 public function setQueue(EntityQueueInterface $queue);
30 * Whether or not the handler supports multiple subqueues.
34 public function supportsMultipleSubqueues();
37 * Whether or not the handler contains subqueues with an automated lifecycle.
39 * For example, this property controls whether the title of subqueues can be
40 * edited, or if they can be created or deleted through the UI or API calls.
44 public function hasAutomatedSubqueues();
47 * Gets this queue handler's list builder operations.
50 * An array of entity operations, as defined by
51 * \Drupal\Core\Entity\EntityListBuilderInterface::getOperations()
53 public function getQueueListBuilderOperations();
56 * Acts on an entity queue before the presave hook is invoked.
58 * @param \Drupal\entityqueue\EntityQueueInterface
59 * The entity queue object.
60 * @param \Drupal\Core\Entity\EntityStorageInterface $storage
61 * The entity storage object.
63 public function onQueuePreSave(EntityQueueInterface $queue, EntityStorageInterface $storage);
66 * Acts on an entity queue before the insert or update hook is invoked.
68 * @param \Drupal\entityqueue\EntityQueueInterface
69 * The entity queue object.
70 * @param \Drupal\Core\Entity\EntityStorageInterface $storage
71 * The entity storage object.
73 * TRUE if the queue has been updated, or FALSE if it has been inserted.
75 public function onQueuePostSave(EntityQueueInterface $queue, EntityStorageInterface $storage, $update = TRUE);
78 * Acts on entity queues before they are deleted and before hooks are invoked.
80 * @param \Drupal\entityqueue\EntityQueueInterface
81 * The entity queue object.
82 * @param \Drupal\Core\Entity\EntityStorageInterface $storage
83 * The entity storage object.
85 public function onQueuePreDelete(EntityQueueInterface $queue, EntityStorageInterface $storage);
88 * Acts on deleted entity queues before the delete hook is invoked.
90 * @param \Drupal\entityqueue\EntityQueueInterface
91 * The entity queue object.
92 * @param \Drupal\Core\Entity\EntityStorageInterface $storage
93 * The entity storage object.
95 public function onQueuePostDelete(EntityQueueInterface $queue, EntityStorageInterface $storage);
98 * Acts on loaded entity queues.
100 * @param \Drupal\entityqueue\EntityQueueInterface
101 * The entity queue object.
102 * @param \Drupal\Core\Entity\EntityStorageInterface $storage
103 * The entity storage object.
105 public function onQueuePostLoad(EntityQueueInterface $queue, EntityStorageInterface $storage);