Updated all the contrib modules to their latest versions.
[yaffs-website] / web / modules / contrib / entityqueue / src / EntityQueueInterface.php
1 <?php
2
3 namespace Drupal\entityqueue;
4
5 use Drupal\Core\Config\Entity\ConfigEntityInterface;
6
7 /**
8  * Provides an interface defining a EntityQueue entity.
9  */
10 interface EntityQueueInterface extends ConfigEntityInterface {
11
12   /**
13    * Gets the EntityQueueHandler plugin ID.
14    *
15    * @return string
16    */
17   public function getHandler();
18
19   /**
20    * Gets the handler plugin configuration for this queue.
21    *
22    * @return mixed[]
23    *   The handler plugin configuration.
24    */
25   public function getHandlerConfiguration();
26
27   /**
28    * Sets the EntityQueueHandler.
29    *
30    * @param string $handler_id
31    *   The handler name.
32    *
33    * @return $this
34    */
35   public function setHandler($handler_id);
36
37   /**
38    * Gets the EntityQueueHandler plugin object.
39    *
40    * @return EntityQueueHandlerInterface
41    */
42   public function getHandlerPlugin();
43
44   /**
45    * Sets the EntityQueueHandler plugin object.
46    *
47    * @param \Drupal\entityqueue\EntityQueueHandlerInterface $handler
48    *   A queue handler plugin.
49    *
50    * @return $this
51    */
52   public function setHandlerPlugin($handler);
53
54   /**
55    * Gets the ID of the target entity type.
56    *
57    * @return string
58    *   The target entity type ID.
59    */
60   public function getTargetEntityTypeId();
61
62   /**
63    * Gets the minimum number of items that this queue can hold.
64    *
65    * @return int
66    */
67   public function getMinimumSize();
68
69   /**
70    * Gets the maximum number of items that this queue can hold.
71    *
72    * @return int
73    */
74   public function getMaximumSize();
75
76   /**
77    * Returns the behavior of exceeding the maximum number of queue items.
78    *
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
81    * queue.
82    *
83    * @return bool
84    */
85   public function getActAsQueue();
86
87   /**
88    * Returns the behavior of editing the queue's items.
89    *
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
92    * bottom.
93    *
94    * If TRUE, this will display the queue such that items will be added to the
95    * top and removed from the bottom.
96    *
97    * @return bool
98    */
99   public function getReverseInAdmin();
100
101   /**
102    * Gets the selection settings used by a subqueue's 'items' reference field.
103    *
104    * @return array
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.
111    */
112   public function getEntitySettings();
113
114   /**
115    * Gets the queue settings.
116    *
117    * @return array
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
122    *     items.
123    *   - reverse_in_admin: Show the items in reverse order when editing a
124    *     subqueue.
125    */
126   public function getQueueSettings();
127
128   /**
129    * Loads one or more queues based on their target entity type.
130    *
131    * @param string $target_entity_type_id
132    *   The target entity type ID.
133    *
134    * @return static[]
135    *   An array of entity queue objects, indexed by their IDs.
136    */
137   public static function loadMultipleByTargetType($target_entity_type_id);
138
139 }