Automatically detect requirements in *.aff.html
[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:32350e9450942f29e7785ceaaed7a1b9)
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 text
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 'add' => NULL,
108 ],
109 'queue_name' => [
110 'name' => 'queue_name',
111 'type' => CRM_Utils_Type::T_STRING,
112 'title' => ts('Queue Name'),
113 'description' => ts('Name of the queue which includes this item'),
114 'required' => TRUE,
115 'maxlength' => 64,
116 'size' => CRM_Utils_Type::BIG,
117 'where' => 'civicrm_queue_item.queue_name',
118 'table_name' => 'civicrm_queue_item',
119 'entity' => 'QueueItem',
120 'bao' => 'CRM_Queue_BAO_QueueItem',
121 'localizable' => 0,
122 'html' => [
123 'type' => 'Text',
124 ],
125 'add' => NULL,
126 ],
127 'weight' => [
128 'name' => 'weight',
129 'type' => CRM_Utils_Type::T_INT,
130 'title' => ts('Order'),
131 'required' => TRUE,
132 'where' => 'civicrm_queue_item.weight',
133 'table_name' => 'civicrm_queue_item',
134 'entity' => 'QueueItem',
135 'bao' => 'CRM_Queue_BAO_QueueItem',
136 'localizable' => 0,
137 'html' => [
138 'type' => 'Text',
139 ],
140 'add' => NULL,
141 ],
142 'submit_time' => [
143 'name' => 'submit_time',
144 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
145 'title' => ts('Submit Time'),
146 'description' => ts('date on which this item was submitted to the queue'),
147 'required' => TRUE,
148 'where' => 'civicrm_queue_item.submit_time',
149 'table_name' => 'civicrm_queue_item',
150 'entity' => 'QueueItem',
151 'bao' => 'CRM_Queue_BAO_QueueItem',
152 'localizable' => 0,
153 'html' => [
154 'type' => 'Select Date',
155 'formatType' => 'activityDateTime',
156 ],
157 'add' => NULL,
158 ],
159 'release_time' => [
160 'name' => 'release_time',
161 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
162 'title' => ts('Release Time'),
163 'description' => ts('date on which this job becomes available; null if ASAP'),
164 'where' => 'civicrm_queue_item.release_time',
165 'table_name' => 'civicrm_queue_item',
166 'entity' => 'QueueItem',
167 'bao' => 'CRM_Queue_BAO_QueueItem',
168 'localizable' => 0,
169 'html' => [
170 'type' => 'Select Date',
171 'formatType' => 'activityDateTime',
172 ],
173 'add' => NULL,
174 ],
175 'data' => [
176 'name' => 'data',
177 'type' => CRM_Utils_Type::T_TEXT,
178 'title' => ts('Queue item data'),
179 'description' => ts('Serialized queue data'),
180 'where' => 'civicrm_queue_item.data',
181 'table_name' => 'civicrm_queue_item',
182 'entity' => 'QueueItem',
183 'bao' => 'CRM_Queue_BAO_QueueItem',
184 'localizable' => 0,
185 'serialize' => self::SERIALIZE_PHP,
186 'add' => NULL,
187 ],
188 ];
189 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
190 }
191 return Civi::$statics[__CLASS__]['fields'];
192 }
193
194 /**
195 * Return a mapping from field-name to the corresponding key (as used in fields()).
196 *
197 * @return array
198 * Array(string $name => string $uniqueName).
199 */
200 public static function &fieldKeys() {
201 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
202 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
203 }
204 return Civi::$statics[__CLASS__]['fieldKeys'];
205 }
206
207 /**
208 * Returns the names of this table
209 *
210 * @return string
211 */
212 public static function getTableName() {
213 return self::$_tableName;
214 }
215
216 /**
217 * Returns if this table needs to be logged
218 *
219 * @return bool
220 */
221 public function getLog() {
222 return self::$_log;
223 }
224
225 /**
226 * Returns the list of fields that can be imported
227 *
228 * @param bool $prefix
229 *
230 * @return array
231 */
232 public static function &import($prefix = FALSE) {
233 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'queue_item', $prefix, []);
234 return $r;
235 }
236
237 /**
238 * Returns the list of fields that can be exported
239 *
240 * @param bool $prefix
241 *
242 * @return array
243 */
244 public static function &export($prefix = FALSE) {
245 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'queue_item', $prefix, []);
246 return $r;
247 }
248
249 /**
250 * Returns the list of indices
251 *
252 * @param bool $localize
253 *
254 * @return array
255 */
256 public static function indices($localize = TRUE) {
257 $indices = [
258 'index_queueids' => [
259 'name' => 'index_queueids',
260 'field' => [
261 0 => 'queue_name',
262 1 => 'weight',
263 2 => 'id',
264 ],
265 'localizable' => FALSE,
266 'sig' => 'civicrm_queue_item::0::queue_name::weight::id',
267 ],
268 ];
269 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
270 }
271
272 }