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:c509d1bc7563d1cddf1b5c823520b32c)
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',
114 'name' => 'queue_name',
115 'type' => CRM_Utils_Type
::T_STRING
,
116 'title' => ts('Queue Name'),
117 'description' => ts('Name of the queue which includes this item'),
120 'size' => CRM_Utils_Type
::BIG
,
121 'where' => 'civicrm_queue_item.queue_name',
122 'table_name' => 'civicrm_queue_item',
123 'entity' => 'QueueItem',
124 'bao' => 'CRM_Queue_BAO_QueueItem',
133 'type' => CRM_Utils_Type
::T_INT
,
134 'title' => ts('Order'),
136 'where' => 'civicrm_queue_item.weight',
137 'table_name' => 'civicrm_queue_item',
138 'entity' => 'QueueItem',
139 'bao' => 'CRM_Queue_BAO_QueueItem',
147 'name' => 'submit_time',
148 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
149 'title' => ts('Submit Time'),
150 'description' => ts('date on which this item was submitted to the queue'),
152 'where' => 'civicrm_queue_item.submit_time',
153 'table_name' => 'civicrm_queue_item',
154 'entity' => 'QueueItem',
155 'bao' => 'CRM_Queue_BAO_QueueItem',
158 'type' => 'Select Date',
159 'formatType' => 'activityDateTime',
164 'name' => 'release_time',
165 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
166 'title' => ts('Release Time'),
167 'description' => ts('date on which this job becomes available; null if ASAP'),
168 'where' => 'civicrm_queue_item.release_time',
169 'table_name' => 'civicrm_queue_item',
170 'entity' => 'QueueItem',
171 'bao' => 'CRM_Queue_BAO_QueueItem',
174 'type' => 'Select Date',
175 'formatType' => 'activityDateTime',
181 'type' => CRM_Utils_Type
::T_LONGTEXT
,
182 'title' => ts('Queue item data'),
183 'description' => ts('Serialized queue data'),
184 'where' => 'civicrm_queue_item.data',
185 'table_name' => 'civicrm_queue_item',
186 'entity' => 'QueueItem',
187 'bao' => 'CRM_Queue_BAO_QueueItem',
189 'serialize' => self
::SERIALIZE_PHP
,
193 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
195 return Civi
::$statics[__CLASS__
]['fields'];
199 * Return a mapping from field-name to the corresponding key (as used in fields()).
202 * Array(string $name => string $uniqueName).
204 public static function &fieldKeys() {
205 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
206 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
208 return Civi
::$statics[__CLASS__
]['fieldKeys'];
212 * Returns the names of this table
216 public static function getTableName() {
217 return self
::$_tableName;
221 * Returns if this table needs to be logged
225 public function getLog() {
230 * Returns the list of fields that can be imported
232 * @param bool $prefix
236 public static function &import($prefix = FALSE) {
237 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'queue_item', $prefix, []);
242 * Returns the list of fields that can be exported
244 * @param bool $prefix
248 public static function &export($prefix = FALSE) {
249 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'queue_item', $prefix, []);
254 * Returns the list of indices
256 * @param bool $localize
260 public static function indices($localize = TRUE) {
262 'index_queueids' => [
263 'name' => 'index_queueids',
269 'localizable' => FALSE,
270 'sig' => 'civicrm_queue_item::0::queue_name::weight::id',
273 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;