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 * Sets the EntityQueueHandler.
22 * @param string $handler
27 public function setHandler($handler);
30 * Gets the EntityQueueHandler plugin object.
32 * @return EntityQueueHandlerInterface
34 public function getHandlerPlugin();
37 * Gets the ID of the target entity type.
40 * The target entity type ID.
42 public function getTargetEntityTypeId();
45 * Gets the minimum number of items that this queue can hold.
49 public function getMinimumSize();
52 * Gets the maximum number of items that this queue can hold.
56 public function getMaximumSize();
59 * Returns the behavior of exceeding the maximum number of queue items.
61 * If TRUE, when a maximum size is set and it is exceeded, the queue will be
62 * truncated to the maximum size by removing items from the front of the
67 public function getActAsQueue();
70 * Returns the behavior of editing the queue's items.
72 * Ordinarily, queues are arranged with the front of the queue (where items
73 * will be removed) on top, and the back (where items will be added) on the
76 * If TRUE, this will display the queue such that items will be added to the
77 * top and removed from the bottom.
81 public function getReverseInAdmin();
84 * Gets the selection settings used by a subqueue's 'items' reference field.
87 * An array with the following keys:
88 * - target_type: The type of the entities that will be queued.
89 * - handler: The entity reference selection handler that will be used by
90 * the subqueue's 'items' field.
91 * - handler_settings: The entity reference selection handler settings that
92 * will be used by the subqueue's 'items' field.
94 public function getEntitySettings();
97 * Gets the queue settings.
100 * An array with the following keys:
101 * - min_size: The minimum number of items that this queue can hold.
102 * - max_size: The maximum number of items that this queue can hold.
103 * - act_as_queue: The behavior of exceeding the maximum number of queue
105 * - reverse_in_admin: Show the items in reverse order when editing a
108 public function getQueueSettings();
111 * Loads one or more queues based on their target entity type.
113 * @param string $target_entity_type_id
114 * The target entity type ID.
117 * An array of entity queue objects, indexed by their IDs.
119 public static function loadMultipleByTargetType($target_entity_type_id);