5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Queue/QueueItem.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:f5163d86b425127deb25d105976212bf)
13 * Database access object for the QueueItem entity.
15 class CRM_Queue_DAO_QueueItem
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '4.2';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_queue_item';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
34 * @var int|string|null
35 * (SQL type: int unsigned)
36 * Note that values will be retrieved from the database as a string.
41 * Name of the queue which includes this item
44 * (SQL type: varchar(64))
45 * Note that values will be retrieved from the database as a string.
52 * Note that values will be retrieved from the database as a string.
57 * date on which this item was submitted to the queue
60 * (SQL type: datetime)
61 * Note that values will be retrieved from the database as a string.
66 * date on which this job becomes available; null if ASAP
69 * (SQL type: datetime)
70 * Note that values will be retrieved from the database as a string.
75 * Number of times execution has been attempted.
79 * Note that values will be retrieved from the database as a string.
84 * Serialized queue data
87 * (SQL type: longtext)
88 * Note that values will be retrieved from the database as a string.
95 public function __construct() {
96 $this->__table
= 'civicrm_queue_item';
97 parent
::__construct();
101 * Returns localized title of this entity.
103 * @param bool $plural
104 * Whether to return the plural version of the title.
106 public static function getEntityTitle($plural = FALSE) {
107 return $plural ?
ts('Queue Items') : ts('Queue Item');
111 * Returns all the column names of this table
115 public static function &fields() {
116 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
117 Civi
::$statics[__CLASS__
]['fields'] = [
120 'type' => CRM_Utils_Type
::T_INT
,
121 'title' => ts('Queue Item ID'),
123 'where' => 'civicrm_queue_item.id',
124 'table_name' => 'civicrm_queue_item',
125 'entity' => 'QueueItem',
126 'bao' => 'CRM_Queue_BAO_QueueItem',
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'),
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',
154 'type' => CRM_Utils_Type
::T_INT
,
155 'title' => ts('Order'),
157 'where' => 'civicrm_queue_item.weight',
158 'table_name' => 'civicrm_queue_item',
159 'entity' => 'QueueItem',
160 'bao' => 'CRM_Queue_BAO_QueueItem',
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'),
173 'where' => 'civicrm_queue_item.submit_time',
174 'table_name' => 'civicrm_queue_item',
175 'entity' => 'QueueItem',
176 'bao' => 'CRM_Queue_BAO_QueueItem',
179 'type' => 'Select Date',
180 'formatType' => 'activityDateTime',
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',
195 'type' => 'Select Date',
196 'formatType' => 'activityDateTime',
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.'),
206 'where' => 'civicrm_queue_item.run_count',
208 'table_name' => 'civicrm_queue_item',
209 'entity' => 'QueueItem',
210 'bao' => 'CRM_Queue_BAO_QueueItem',
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',
227 'serialize' => self
::SERIALIZE_PHP
,
231 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
233 return Civi
::$statics[__CLASS__
]['fields'];
237 * Return a mapping from field-name to the corresponding key (as used in fields()).
240 * Array(string $name => string $uniqueName).
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()));
246 return Civi
::$statics[__CLASS__
]['fieldKeys'];
250 * Returns the names of this table
254 public static function getTableName() {
255 return self
::$_tableName;
259 * Returns if this table needs to be logged
263 public function getLog() {
268 * Returns the list of fields that can be imported
270 * @param bool $prefix
274 public static function &import($prefix = FALSE) {
275 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'queue_item', $prefix, []);
280 * Returns the list of fields that can be exported
282 * @param bool $prefix
286 public static function &export($prefix = FALSE) {
287 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'queue_item', $prefix, []);
292 * Returns the list of indices
294 * @param bool $localize
298 public static function indices($localize = TRUE) {
300 'index_queueids' => [
301 'name' => 'index_queueids',
307 'localizable' => FALSE,
308 'sig' => 'civicrm_queue_item::0::queue_name::weight::id',
311 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;