3 namespace Drupal\entityqueue;
5 use Drupal\Core\Config\Entity\ConfigEntityInterface;
8 * Provides an interface defining a EntityQueue entity.
10 interface EntityQueueInterface extends ConfigEntityInterface {
13 * Gets the EntityQueueHandler plugin ID.
17 public function getHandler();
20 * Gets the handler plugin configuration for this queue.
23 * The handler plugin configuration.
25 public function getHandlerConfiguration();
28 * Sets the EntityQueueHandler.
30 * @param string $handler_id
35 public function setHandler($handler_id);
38 * Gets the EntityQueueHandler plugin object.
40 * @return EntityQueueHandlerInterface
42 public function getHandlerPlugin();
45 * Sets the EntityQueueHandler plugin object.
47 * @param \Drupal\entityqueue\EntityQueueHandlerInterface $handler
48 * A queue handler plugin.
52 public function setHandlerPlugin($handler);
55 * Gets the ID of the target entity type.
58 * The target entity type ID.
60 public function getTargetEntityTypeId();
63 * Gets the minimum number of items that this queue can hold.
67 public function getMinimumSize();
70 * Gets the maximum number of items that this queue can hold.
74 public function getMaximumSize();
77 * Returns the behavior of exceeding the maximum number of queue items.
79 * If TRUE, when a maximum size is set and it is exceeded, the queue will be
80 * truncated to the maximum size by removing items from the front of the
85 public function getActAsQueue();
88 * Returns the behavior of editing the queue's items.
90 * Ordinarily, queues are arranged with the front of the queue (where items
91 * will be removed) on top, and the back (where items will be added) on the
94 * If TRUE, this will display the queue such that items will be added to the
95 * top and removed from the bottom.
99 public function getReverseInAdmin();
102 * Gets the selection settings used by a subqueue's 'items' reference field.
105 * An array with the following keys:
106 * - target_type: The type of the entities that will be queued.
107 * - handler: The entity reference selection handler that will be used by
108 * the subqueue's 'items' field.
109 * - handler_settings: The entity reference selection handler settings that
110 * will be used by the subqueue's 'items' field.
112 public function getEntitySettings();
115 * Gets the queue settings.
118 * An array with the following keys:
119 * - min_size: The minimum number of items that this queue can hold.
120 * - max_size: The maximum number of items that this queue can hold.
121 * - act_as_queue: The behavior of exceeding the maximum number of queue
123 * - reverse_in_admin: Show the items in reverse order when editing a
126 public function getQueueSettings();
129 * Loads one or more queues based on their target entity type.
131 * @param string $target_entity_type_id
132 * The target entity type ID.
135 * An array of entity queue objects, indexed by their IDs.
137 public static function loadMultipleByTargetType($target_entity_type_id);