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:21270fc0075d353032051ac4343095bc)
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;
39 * Name of the queue which includes this item
51 * date on which this item was submitted to the queue
58 * date on which this job becomes available; null if ASAP
65 * Serialized queue data
74 public function __construct() {
75 $this->__table
= 'civicrm_queue_item';
76 parent
::__construct();
80 * Returns localized title of this entity.
83 * Whether to return the plural version of the title.
85 public static function getEntityTitle($plural = FALSE) {
86 return $plural ?
ts('Queue Items') : ts('Queue Item');
90 * Returns all the column names of this table
94 public static function &fields() {
95 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
96 Civi
::$statics[__CLASS__
]['fields'] = [
99 'type' => CRM_Utils_Type
::T_INT
,
100 'title' => ts('Queue ID'),
102 'where' => 'civicrm_queue_item.id',
103 'table_name' => 'civicrm_queue_item',
104 'entity' => 'QueueItem',
105 'bao' => 'CRM_Queue_BAO_QueueItem',
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'),
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',
129 'type' => CRM_Utils_Type
::T_INT
,
130 'title' => ts('Order'),
132 'where' => 'civicrm_queue_item.weight',
133 'table_name' => 'civicrm_queue_item',
134 'entity' => 'QueueItem',
135 'bao' => 'CRM_Queue_BAO_QueueItem',
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'),
148 'where' => 'civicrm_queue_item.submit_time',
149 'table_name' => 'civicrm_queue_item',
150 'entity' => 'QueueItem',
151 'bao' => 'CRM_Queue_BAO_QueueItem',
154 'type' => 'Select Date',
155 'formatType' => 'activityDateTime',
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',
170 'type' => 'Select Date',
171 'formatType' => 'activityDateTime',
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',
185 'serialize' => self
::SERIALIZE_PHP
,
189 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
191 return Civi
::$statics[__CLASS__
]['fields'];
195 * Return a mapping from field-name to the corresponding key (as used in fields()).
198 * Array(string $name => string $uniqueName).
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()));
204 return Civi
::$statics[__CLASS__
]['fieldKeys'];
208 * Returns the names of this table
212 public static function getTableName() {
213 return self
::$_tableName;
217 * Returns if this table needs to be logged
221 public function getLog() {
226 * Returns the list of fields that can be imported
228 * @param bool $prefix
232 public static function &import($prefix = FALSE) {
233 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'queue_item', $prefix, []);
238 * Returns the list of fields that can be exported
240 * @param bool $prefix
244 public static function &export($prefix = FALSE) {
245 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'queue_item', $prefix, []);
250 * Returns the list of indices
252 * @param bool $localize
256 public static function indices($localize = TRUE) {
258 'index_queueids' => [
259 'name' => 'index_queueids',
265 'localizable' => FALSE,
266 'sig' => 'civicrm_queue_item::0::queue_name::weight::id',
269 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;