Merge pull request #22804 from braders/core-2198-dedupe-rules-ui
[civicrm-core.git] / CRM / Queue / DAO / QueueItem.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Queue/QueueItem.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:f5163d86b425127deb25d105976212bf)
10 */
11
12 /**
13 * Database access object for the QueueItem entity.
14 */
15 class CRM_Queue_DAO_QueueItem extends CRM_Core_DAO {
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '4.2';
18
19 /**
20 * Static instance to hold the table name.
21 *
22 * @var string
23 */
24 public static $_tableName = 'civicrm_queue_item';
25
26 /**
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
28 *
29 * @var bool
30 */
31 public static $_log = FALSE;
32
33 /**
34 * @var int|string|null
35 * (SQL type: int unsigned)
36 * Note that values will be retrieved from the database as a string.
37 */
38 public $id;
39
40 /**
41 * Name of the queue which includes this item
42 *
43 * @var string
44 * (SQL type: varchar(64))
45 * Note that values will be retrieved from the database as a string.
46 */
47 public $queue_name;
48
49 /**
50 * @var int|string
51 * (SQL type: int)
52 * Note that values will be retrieved from the database as a string.
53 */
54 public $weight;
55
56 /**
57 * date on which this item was submitted to the queue
58 *
59 * @var string
60 * (SQL type: datetime)
61 * Note that values will be retrieved from the database as a string.
62 */
63 public $submit_time;
64
65 /**
66 * date on which this job becomes available; null if ASAP
67 *
68 * @var string|null
69 * (SQL type: datetime)
70 * Note that values will be retrieved from the database as a string.
71 */
72 public $release_time;
73
74 /**
75 * Number of times execution has been attempted.
76 *
77 * @var int|string
78 * (SQL type: int)
79 * Note that values will be retrieved from the database as a string.
80 */
81 public $run_count;
82
83 /**
84 * Serialized queue data
85 *
86 * @var string|null
87 * (SQL type: longtext)
88 * Note that values will be retrieved from the database as a string.
89 */
90 public $data;
91
92 /**
93 * Class constructor.
94 */
95 public function __construct() {
96 $this->__table = 'civicrm_queue_item';
97 parent::__construct();
98 }
99
100 /**
101 * Returns localized title of this entity.
102 *
103 * @param bool $plural
104 * Whether to return the plural version of the title.
105 */
106 public static function getEntityTitle($plural = FALSE) {
107 return $plural ? ts('Queue Items') : ts('Queue Item');
108 }
109
110 /**
111 * Returns all the column names of this table
112 *
113 * @return array
114 */
115 public static function &fields() {
116 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
117 Civi::$statics[__CLASS__]['fields'] = [
118 'id' => [
119 'name' => 'id',
120 'type' => CRM_Utils_Type::T_INT,
121 'title' => ts('Queue Item ID'),
122 'required' => TRUE,
123 'where' => 'civicrm_queue_item.id',
124 'table_name' => 'civicrm_queue_item',
125 'entity' => 'QueueItem',
126 'bao' => 'CRM_Queue_BAO_QueueItem',
127 'localizable' => 0,
128 'html' => [
129 'type' => 'Number',
130 ],
131 'readonly' => TRUE,
132 'add' => NULL,
133 ],
134 'queue_name' => [
135 'name' => 'queue_name',
136 'type' => CRM_Utils_Type::T_STRING,
137 'title' => ts('Queue Name'),
138 'description' => ts('Name of the queue which includes this item'),
139 'required' => TRUE,
140 'maxlength' => 64,
141 'size' => CRM_Utils_Type::BIG,
142 'where' => 'civicrm_queue_item.queue_name',
143 'table_name' => 'civicrm_queue_item',
144 'entity' => 'QueueItem',
145 'bao' => 'CRM_Queue_BAO_QueueItem',
146 'localizable' => 0,
147 'html' => [
148 'type' => 'Text',
149 ],
150 'add' => NULL,
151 ],
152 'weight' => [
153 'name' => 'weight',
154 'type' => CRM_Utils_Type::T_INT,
155 'title' => ts('Order'),
156 'required' => TRUE,
157 'where' => 'civicrm_queue_item.weight',
158 'table_name' => 'civicrm_queue_item',
159 'entity' => 'QueueItem',
160 'bao' => 'CRM_Queue_BAO_QueueItem',
161 'localizable' => 0,
162 'html' => [
163 'type' => 'Text',
164 ],
165 'add' => NULL,
166 ],
167 'submit_time' => [
168 'name' => 'submit_time',
169 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
170 'title' => ts('Submit Time'),
171 'description' => ts('date on which this item was submitted to the queue'),
172 'required' => TRUE,
173 'where' => 'civicrm_queue_item.submit_time',
174 'table_name' => 'civicrm_queue_item',
175 'entity' => 'QueueItem',
176 'bao' => 'CRM_Queue_BAO_QueueItem',
177 'localizable' => 0,
178 'html' => [
179 'type' => 'Select Date',
180 'formatType' => 'activityDateTime',
181 ],
182 'add' => NULL,
183 ],
184 'release_time' => [
185 'name' => 'release_time',
186 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
187 'title' => ts('Release Time'),
188 'description' => ts('date on which this job becomes available; null if ASAP'),
189 'where' => 'civicrm_queue_item.release_time',
190 'table_name' => 'civicrm_queue_item',
191 'entity' => 'QueueItem',
192 'bao' => 'CRM_Queue_BAO_QueueItem',
193 'localizable' => 0,
194 'html' => [
195 'type' => 'Select Date',
196 'formatType' => 'activityDateTime',
197 ],
198 'add' => NULL,
199 ],
200 'run_count' => [
201 'name' => 'run_count',
202 'type' => CRM_Utils_Type::T_INT,
203 'title' => ts('Run Count'),
204 'description' => ts('Number of times execution has been attempted.'),
205 'required' => TRUE,
206 'where' => 'civicrm_queue_item.run_count',
207 'default' => '0',
208 'table_name' => 'civicrm_queue_item',
209 'entity' => 'QueueItem',
210 'bao' => 'CRM_Queue_BAO_QueueItem',
211 'localizable' => 0,
212 'html' => [
213 'type' => 'Text',
214 ],
215 'add' => '5.48',
216 ],
217 'data' => [
218 'name' => 'data',
219 'type' => CRM_Utils_Type::T_LONGTEXT,
220 'title' => ts('Queue item data'),
221 'description' => ts('Serialized queue data'),
222 'where' => 'civicrm_queue_item.data',
223 'table_name' => 'civicrm_queue_item',
224 'entity' => 'QueueItem',
225 'bao' => 'CRM_Queue_BAO_QueueItem',
226 'localizable' => 0,
227 'serialize' => self::SERIALIZE_PHP,
228 'add' => NULL,
229 ],
230 ];
231 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
232 }
233 return Civi::$statics[__CLASS__]['fields'];
234 }
235
236 /**
237 * Return a mapping from field-name to the corresponding key (as used in fields()).
238 *
239 * @return array
240 * Array(string $name => string $uniqueName).
241 */
242 public static function &fieldKeys() {
243 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
244 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
245 }
246 return Civi::$statics[__CLASS__]['fieldKeys'];
247 }
248
249 /**
250 * Returns the names of this table
251 *
252 * @return string
253 */
254 public static function getTableName() {
255 return self::$_tableName;
256 }
257
258 /**
259 * Returns if this table needs to be logged
260 *
261 * @return bool
262 */
263 public function getLog() {
264 return self::$_log;
265 }
266
267 /**
268 * Returns the list of fields that can be imported
269 *
270 * @param bool $prefix
271 *
272 * @return array
273 */
274 public static function &import($prefix = FALSE) {
275 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'queue_item', $prefix, []);
276 return $r;
277 }
278
279 /**
280 * Returns the list of fields that can be exported
281 *
282 * @param bool $prefix
283 *
284 * @return array
285 */
286 public static function &export($prefix = FALSE) {
287 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'queue_item', $prefix, []);
288 return $r;
289 }
290
291 /**
292 * Returns the list of indices
293 *
294 * @param bool $localize
295 *
296 * @return array
297 */
298 public static function indices($localize = TRUE) {
299 $indices = [
300 'index_queueids' => [
301 'name' => 'index_queueids',
302 'field' => [
303 0 => 'queue_name',
304 1 => 'weight',
305 2 => 'id',
306 ],
307 'localizable' => FALSE,
308 'sig' => 'civicrm_queue_item::0::queue_name::weight::id',
309 ],
310 ];
311 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
312 }
313
314 }