Merge pull request #20450 from jaapjansma/dev_financials_6_reports
[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:c509d1bc7563d1cddf1b5c823520b32c)
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
35 */
36 public $id;
37
38 /**
39 * Name of the queue which includes this item
40 *
41 * @var string
42 */
43 public $queue_name;
44
45 /**
46 * @var int
47 */
48 public $weight;
49
50 /**
51 * date on which this item was submitted to the queue
52 *
53 * @var datetime
54 */
55 public $submit_time;
56
57 /**
58 * date on which this job becomes available; null if ASAP
59 *
60 * @var datetime
61 */
62 public $release_time;
63
64 /**
65 * Serialized queue data
66 *
67 * @var longtext
68 */
69 public $data;
70
71 /**
72 * Class constructor.
73 */
74 public function __construct() {
75 $this->__table = 'civicrm_queue_item';
76 parent::__construct();
77 }
78
79 /**
80 * Returns localized title of this entity.
81 *
82 * @param bool $plural
83 * Whether to return the plural version of the title.
84 */
85 public static function getEntityTitle($plural = FALSE) {
86 return $plural ? ts('Queue Items') : ts('Queue Item');
87 }
88
89 /**
90 * Returns all the column names of this table
91 *
92 * @return array
93 */
94 public static function &fields() {
95 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
96 Civi::$statics[__CLASS__]['fields'] = [
97 'id' => [
98 'name' => 'id',
99 'type' => CRM_Utils_Type::T_INT,
100 'title' => ts('Queue ID'),
101 'required' => TRUE,
102 'where' => 'civicrm_queue_item.id',
103 'table_name' => 'civicrm_queue_item',
104 'entity' => 'QueueItem',
105 'bao' => 'CRM_Queue_BAO_QueueItem',
106 'localizable' => 0,
107 'html' => [
108 'type' => 'Number',
109 ],
110 'readonly' => TRUE,
111 'add' => NULL,
112 ],
113 'queue_name' => [
114 'name' => 'queue_name',
115 'type' => CRM_Utils_Type::T_STRING,
116 'title' => ts('Queue Name'),
117 'description' => ts('Name of the queue which includes this item'),
118 'required' => TRUE,
119 'maxlength' => 64,
120 'size' => CRM_Utils_Type::BIG,
121 'where' => 'civicrm_queue_item.queue_name',
122 'table_name' => 'civicrm_queue_item',
123 'entity' => 'QueueItem',
124 'bao' => 'CRM_Queue_BAO_QueueItem',
125 'localizable' => 0,
126 'html' => [
127 'type' => 'Text',
128 ],
129 'add' => NULL,
130 ],
131 'weight' => [
132 'name' => 'weight',
133 'type' => CRM_Utils_Type::T_INT,
134 'title' => ts('Order'),
135 'required' => TRUE,
136 'where' => 'civicrm_queue_item.weight',
137 'table_name' => 'civicrm_queue_item',
138 'entity' => 'QueueItem',
139 'bao' => 'CRM_Queue_BAO_QueueItem',
140 'localizable' => 0,
141 'html' => [
142 'type' => 'Text',
143 ],
144 'add' => NULL,
145 ],
146 'submit_time' => [
147 'name' => 'submit_time',
148 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
149 'title' => ts('Submit Time'),
150 'description' => ts('date on which this item was submitted to the queue'),
151 'required' => TRUE,
152 'where' => 'civicrm_queue_item.submit_time',
153 'table_name' => 'civicrm_queue_item',
154 'entity' => 'QueueItem',
155 'bao' => 'CRM_Queue_BAO_QueueItem',
156 'localizable' => 0,
157 'html' => [
158 'type' => 'Select Date',
159 'formatType' => 'activityDateTime',
160 ],
161 'add' => NULL,
162 ],
163 'release_time' => [
164 'name' => 'release_time',
165 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
166 'title' => ts('Release Time'),
167 'description' => ts('date on which this job becomes available; null if ASAP'),
168 'where' => 'civicrm_queue_item.release_time',
169 'table_name' => 'civicrm_queue_item',
170 'entity' => 'QueueItem',
171 'bao' => 'CRM_Queue_BAO_QueueItem',
172 'localizable' => 0,
173 'html' => [
174 'type' => 'Select Date',
175 'formatType' => 'activityDateTime',
176 ],
177 'add' => NULL,
178 ],
179 'data' => [
180 'name' => 'data',
181 'type' => CRM_Utils_Type::T_LONGTEXT,
182 'title' => ts('Queue item data'),
183 'description' => ts('Serialized queue data'),
184 'where' => 'civicrm_queue_item.data',
185 'table_name' => 'civicrm_queue_item',
186 'entity' => 'QueueItem',
187 'bao' => 'CRM_Queue_BAO_QueueItem',
188 'localizable' => 0,
189 'serialize' => self::SERIALIZE_PHP,
190 'add' => NULL,
191 ],
192 ];
193 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
194 }
195 return Civi::$statics[__CLASS__]['fields'];
196 }
197
198 /**
199 * Return a mapping from field-name to the corresponding key (as used in fields()).
200 *
201 * @return array
202 * Array(string $name => string $uniqueName).
203 */
204 public static function &fieldKeys() {
205 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
206 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
207 }
208 return Civi::$statics[__CLASS__]['fieldKeys'];
209 }
210
211 /**
212 * Returns the names of this table
213 *
214 * @return string
215 */
216 public static function getTableName() {
217 return self::$_tableName;
218 }
219
220 /**
221 * Returns if this table needs to be logged
222 *
223 * @return bool
224 */
225 public function getLog() {
226 return self::$_log;
227 }
228
229 /**
230 * Returns the list of fields that can be imported
231 *
232 * @param bool $prefix
233 *
234 * @return array
235 */
236 public static function &import($prefix = FALSE) {
237 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'queue_item', $prefix, []);
238 return $r;
239 }
240
241 /**
242 * Returns the list of fields that can be exported
243 *
244 * @param bool $prefix
245 *
246 * @return array
247 */
248 public static function &export($prefix = FALSE) {
249 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'queue_item', $prefix, []);
250 return $r;
251 }
252
253 /**
254 * Returns the list of indices
255 *
256 * @param bool $localize
257 *
258 * @return array
259 */
260 public static function indices($localize = TRUE) {
261 $indices = [
262 'index_queueids' => [
263 'name' => 'index_queueids',
264 'field' => [
265 0 => 'queue_name',
266 1 => 'weight',
267 2 => 'id',
268 ],
269 'localizable' => FALSE,
270 'sig' => 'civicrm_queue_item::0::queue_name::weight::id',
271 ],
272 ];
273 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
274 }
275
276 }