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:36871610524adb64bc8aa3bb24b295f4)
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 * Serialized queue data
78 * (SQL type: longtext)
79 * Note that values will be retrieved from the database as a string.
86 public function __construct() {
87 $this->__table
= 'civicrm_queue_item';
88 parent
::__construct();
92 * Returns localized title of this entity.
95 * Whether to return the plural version of the title.
97 public static function getEntityTitle($plural = FALSE) {
98 return $plural ?
ts('Queue Items') : ts('Queue Item');
102 * Returns all the column names of this table
106 public static function &fields() {
107 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
108 Civi
::$statics[__CLASS__
]['fields'] = [
111 'type' => CRM_Utils_Type
::T_INT
,
112 'title' => ts('Queue Item ID'),
114 'where' => 'civicrm_queue_item.id',
115 'table_name' => 'civicrm_queue_item',
116 'entity' => 'QueueItem',
117 'bao' => 'CRM_Queue_BAO_QueueItem',
126 'name' => 'queue_name',
127 'type' => CRM_Utils_Type
::T_STRING
,
128 'title' => ts('Queue Name'),
129 'description' => ts('Name of the queue which includes this item'),
132 'size' => CRM_Utils_Type
::BIG
,
133 'where' => 'civicrm_queue_item.queue_name',
134 'table_name' => 'civicrm_queue_item',
135 'entity' => 'QueueItem',
136 'bao' => 'CRM_Queue_BAO_QueueItem',
145 'type' => CRM_Utils_Type
::T_INT
,
146 'title' => ts('Order'),
148 'where' => 'civicrm_queue_item.weight',
149 'table_name' => 'civicrm_queue_item',
150 'entity' => 'QueueItem',
151 'bao' => 'CRM_Queue_BAO_QueueItem',
159 'name' => 'submit_time',
160 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
161 'title' => ts('Submit Time'),
162 'description' => ts('date on which this item was submitted to the queue'),
164 'where' => 'civicrm_queue_item.submit_time',
165 'table_name' => 'civicrm_queue_item',
166 'entity' => 'QueueItem',
167 'bao' => 'CRM_Queue_BAO_QueueItem',
170 'type' => 'Select Date',
171 'formatType' => 'activityDateTime',
176 'name' => 'release_time',
177 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
178 'title' => ts('Release Time'),
179 'description' => ts('date on which this job becomes available; null if ASAP'),
180 'where' => 'civicrm_queue_item.release_time',
181 'table_name' => 'civicrm_queue_item',
182 'entity' => 'QueueItem',
183 'bao' => 'CRM_Queue_BAO_QueueItem',
186 'type' => 'Select Date',
187 'formatType' => 'activityDateTime',
193 'type' => CRM_Utils_Type
::T_LONGTEXT
,
194 'title' => ts('Queue item data'),
195 'description' => ts('Serialized queue data'),
196 'where' => 'civicrm_queue_item.data',
197 'table_name' => 'civicrm_queue_item',
198 'entity' => 'QueueItem',
199 'bao' => 'CRM_Queue_BAO_QueueItem',
201 'serialize' => self
::SERIALIZE_PHP
,
205 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
207 return Civi
::$statics[__CLASS__
]['fields'];
211 * Return a mapping from field-name to the corresponding key (as used in fields()).
214 * Array(string $name => string $uniqueName).
216 public static function &fieldKeys() {
217 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
218 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
220 return Civi
::$statics[__CLASS__
]['fieldKeys'];
224 * Returns the names of this table
228 public static function getTableName() {
229 return self
::$_tableName;
233 * Returns if this table needs to be logged
237 public function getLog() {
242 * Returns the list of fields that can be imported
244 * @param bool $prefix
248 public static function &import($prefix = FALSE) {
249 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'queue_item', $prefix, []);
254 * Returns the list of fields that can be exported
256 * @param bool $prefix
260 public static function &export($prefix = FALSE) {
261 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'queue_item', $prefix, []);
266 * Returns the list of indices
268 * @param bool $localize
272 public static function indices($localize = TRUE) {
274 'index_queueids' => [
275 'name' => 'index_queueids',
281 'localizable' => FALSE,
282 'sig' => 'civicrm_queue_item::0::queue_name::weight::id',
285 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;