Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
8c9251b3 | 5 | * @copyright CiviCRM LLC (c) 2004-2018 |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Queue/QueueItem.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
e380ee3b | 9 | * (GenCodeChecksum:c9e273e55020d73d90150ef7d6e04312) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the QueueItem entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Queue_DAO_QueueItem extends CRM_Core_DAO { |
c3fc2621 | 16 | |
e501603b | 17 | /** |
f41f0342 | 18 | * Static instance to hold the table name. |
e501603b TO |
19 | * |
20 | * @var string | |
21 | */ | |
22 | static $_tableName = 'civicrm_queue_item'; | |
c3fc2621 | 23 | |
e501603b | 24 | /** |
f41f0342 | 25 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 26 | * |
c3fc2621 | 27 | * @var bool |
e501603b | 28 | */ |
c3fc2621 CW |
29 | static $_log = FALSE; |
30 | ||
e501603b | 31 | /** |
e501603b TO |
32 | * @var int unsigned |
33 | */ | |
34 | public $id; | |
c3fc2621 | 35 | |
e501603b TO |
36 | /** |
37 | * Name of the queue which includes this item | |
38 | * | |
39 | * @var string | |
40 | */ | |
41 | public $queue_name; | |
c3fc2621 | 42 | |
e501603b | 43 | /** |
e501603b TO |
44 | * @var int |
45 | */ | |
46 | public $weight; | |
c3fc2621 | 47 | |
e501603b TO |
48 | /** |
49 | * date on which this item was submitted to the queue | |
50 | * | |
51 | * @var datetime | |
52 | */ | |
53 | public $submit_time; | |
c3fc2621 | 54 | |
e501603b TO |
55 | /** |
56 | * date on which this job becomes available; null if ASAP | |
57 | * | |
58 | * @var datetime | |
59 | */ | |
60 | public $release_time; | |
c3fc2621 | 61 | |
e501603b | 62 | /** |
2a5c9b4d | 63 | * Serialized queue data |
e501603b TO |
64 | * |
65 | * @var text | |
66 | */ | |
67 | public $data; | |
c3fc2621 | 68 | |
e501603b | 69 | /** |
f41f0342 | 70 | * Class constructor. |
e501603b | 71 | */ |
c3fc2621 | 72 | public function __construct() { |
e501603b TO |
73 | $this->__table = 'civicrm_queue_item'; |
74 | parent::__construct(); | |
75 | } | |
c3fc2621 | 76 | |
e501603b TO |
77 | /** |
78 | * Returns all the column names of this table | |
79 | * | |
80 | * @return array | |
81 | */ | |
c3fc2621 | 82 | public static function &fields() { |
346aaaba | 83 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
84 | Civi::$statics[__CLASS__]['fields'] = [ |
85 | 'id' => [ | |
e501603b TO |
86 | 'name' => 'id', |
87 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 CW |
88 | 'title' => ts('Queue ID'), |
89 | 'required' => TRUE, | |
522a26c9 | 90 | 'table_name' => 'civicrm_queue_item', |
91 | 'entity' => 'QueueItem', | |
92 | 'bao' => 'CRM_Queue_BAO_QueueItem', | |
6a7e5e5d | 93 | 'localizable' => 0, |
c3fc2621 CW |
94 | ], |
95 | 'queue_name' => [ | |
e501603b TO |
96 | 'name' => 'queue_name', |
97 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 98 | 'title' => ts('Queue Name'), |
215b423e | 99 | 'description' => ts('Name of the queue which includes this item'), |
c3fc2621 | 100 | 'required' => TRUE, |
e501603b TO |
101 | 'maxlength' => 64, |
102 | 'size' => CRM_Utils_Type::BIG, | |
522a26c9 | 103 | 'table_name' => 'civicrm_queue_item', |
104 | 'entity' => 'QueueItem', | |
105 | 'bao' => 'CRM_Queue_BAO_QueueItem', | |
6a7e5e5d | 106 | 'localizable' => 0, |
c3fc2621 | 107 | 'html' => [ |
e501603b | 108 | 'type' => 'Text', |
c3fc2621 CW |
109 | ], |
110 | ], | |
111 | 'weight' => [ | |
e501603b TO |
112 | 'name' => 'weight', |
113 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 CW |
114 | 'title' => ts('Order'), |
115 | 'required' => TRUE, | |
522a26c9 | 116 | 'table_name' => 'civicrm_queue_item', |
117 | 'entity' => 'QueueItem', | |
118 | 'bao' => 'CRM_Queue_BAO_QueueItem', | |
6a7e5e5d | 119 | 'localizable' => 0, |
c3fc2621 | 120 | 'html' => [ |
e501603b | 121 | 'type' => 'Text', |
c3fc2621 CW |
122 | ], |
123 | ], | |
124 | 'submit_time' => [ | |
e501603b TO |
125 | 'name' => 'submit_time', |
126 | 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, | |
c3fc2621 | 127 | 'title' => ts('Submit Time'), |
215b423e | 128 | 'description' => ts('date on which this item was submitted to the queue'), |
c3fc2621 | 129 | 'required' => TRUE, |
522a26c9 | 130 | 'table_name' => 'civicrm_queue_item', |
131 | 'entity' => 'QueueItem', | |
132 | 'bao' => 'CRM_Queue_BAO_QueueItem', | |
6a7e5e5d | 133 | 'localizable' => 0, |
c3fc2621 | 134 | 'html' => [ |
e501603b | 135 | 'type' => 'Select Date', |
c3fc2621 CW |
136 | ], |
137 | ], | |
138 | 'release_time' => [ | |
e501603b TO |
139 | 'name' => 'release_time', |
140 | 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, | |
c3fc2621 | 141 | 'title' => ts('Release Time'), |
215b423e | 142 | 'description' => ts('date on which this job becomes available; null if ASAP'), |
522a26c9 | 143 | 'table_name' => 'civicrm_queue_item', |
144 | 'entity' => 'QueueItem', | |
145 | 'bao' => 'CRM_Queue_BAO_QueueItem', | |
6a7e5e5d | 146 | 'localizable' => 0, |
c3fc2621 | 147 | 'html' => [ |
e501603b | 148 | 'type' => 'Select Date', |
c3fc2621 CW |
149 | ], |
150 | ], | |
151 | 'data' => [ | |
e501603b TO |
152 | 'name' => 'data', |
153 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 154 | 'title' => ts('Queue item data'), |
215b423e | 155 | 'description' => ts('Serialized queue data'), |
522a26c9 | 156 | 'table_name' => 'civicrm_queue_item', |
157 | 'entity' => 'QueueItem', | |
158 | 'bao' => 'CRM_Queue_BAO_QueueItem', | |
6a7e5e5d | 159 | 'localizable' => 0, |
2a5c9b4d | 160 | 'serialize' => self::SERIALIZE_PHP, |
c3fc2621 CW |
161 | ], |
162 | ]; | |
346aaaba | 163 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 164 | } |
346aaaba | 165 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 166 | } |
c3fc2621 | 167 | |
e501603b | 168 | /** |
bd8e0b14 | 169 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
170 | * |
171 | * @return array | |
bd8e0b14 | 172 | * Array(string $name => string $uniqueName). |
e501603b | 173 | */ |
c3fc2621 | 174 | public static function &fieldKeys() { |
bd8e0b14 TO |
175 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
176 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 177 | } |
bd8e0b14 | 178 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 179 | } |
c3fc2621 | 180 | |
e501603b TO |
181 | /** |
182 | * Returns the names of this table | |
183 | * | |
184 | * @return string | |
185 | */ | |
c3fc2621 | 186 | public static function getTableName() { |
e501603b TO |
187 | return self::$_tableName; |
188 | } | |
c3fc2621 | 189 | |
e501603b TO |
190 | /** |
191 | * Returns if this table needs to be logged | |
192 | * | |
c3fc2621 | 193 | * @return bool |
e501603b | 194 | */ |
c3fc2621 | 195 | public function getLog() { |
e501603b TO |
196 | return self::$_log; |
197 | } | |
c3fc2621 | 198 | |
e501603b TO |
199 | /** |
200 | * Returns the list of fields that can be imported | |
201 | * | |
202 | * @param bool $prefix | |
203 | * | |
204 | * @return array | |
205 | */ | |
c3fc2621 CW |
206 | public static function &import($prefix = FALSE) { |
207 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'queue_item', $prefix, []); | |
60808919 | 208 | return $r; |
e501603b | 209 | } |
c3fc2621 | 210 | |
e501603b TO |
211 | /** |
212 | * Returns the list of fields that can be exported | |
213 | * | |
214 | * @param bool $prefix | |
215 | * | |
216 | * @return array | |
217 | */ | |
c3fc2621 CW |
218 | public static function &export($prefix = FALSE) { |
219 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'queue_item', $prefix, []); | |
60808919 | 220 | return $r; |
e501603b | 221 | } |
c3fc2621 | 222 | |
e7a6b91a AS |
223 | /** |
224 | * Returns the list of indices | |
c3fc2621 CW |
225 | * |
226 | * @param bool $localize | |
227 | * | |
228 | * @return array | |
e7a6b91a AS |
229 | */ |
230 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
231 | $indices = [ |
232 | 'index_queueids' => [ | |
e7a6b91a | 233 | 'name' => 'index_queueids', |
c3fc2621 | 234 | 'field' => [ |
e7a6b91a AS |
235 | 0 => 'queue_name', |
236 | 1 => 'weight', | |
237 | 2 => 'id', | |
c3fc2621 CW |
238 | ], |
239 | 'localizable' => FALSE, | |
e7a6b91a | 240 | 'sig' => 'civicrm_queue_item::0::queue_name::weight::id', |
c3fc2621 CW |
241 | ], |
242 | ]; | |
e7a6b91a AS |
243 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
244 | } | |
c3fc2621 | 245 | |
e501603b | 246 | } |