5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Queue/Queue.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:3b50eca7549430727237a4b2e295df1f)
13 * Database access object for the Queue entity.
15 class CRM_Queue_DAO_Queue
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '5.47';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_queue';
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.
44 * (SQL type: varchar(64))
45 * Note that values will be retrieved from the database as a string.
53 * (SQL type: varchar(64))
54 * Note that values will be retrieved from the database as a string.
59 * Name of the task runner
62 * (SQL type: varchar(64))
63 * Note that values will be retrieved from the database as a string.
68 * Maximum number of items in a batch.
71 * (SQL type: int unsigned)
72 * Note that values will be retrieved from the database as a string.
77 * When claiming an item (or batch of items) for work, how long should the item(s) be reserved. (Seconds)
80 * (SQL type: int unsigned)
81 * Note that values will be retrieved from the database as a string.
86 * Number of permitted retries. Set to zero (0) to disable.
90 * Note that values will be retrieved from the database as a string.
95 * Number of seconds to wait before retrying a failed execution.
99 * Note that values will be retrieved from the database as a string.
101 public $retry_interval;
106 public function __construct() {
107 $this->__table
= 'civicrm_queue';
108 parent
::__construct();
112 * Returns localized title of this entity.
114 * @param bool $plural
115 * Whether to return the plural version of the title.
117 public static function getEntityTitle($plural = FALSE) {
118 return $plural ?
ts('Queues') : ts('Queue');
122 * Returns all the column names of this table
126 public static function &fields() {
127 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
128 Civi
::$statics[__CLASS__
]['fields'] = [
131 'type' => CRM_Utils_Type
::T_INT
,
132 'title' => ts('System Queue ID'),
134 'where' => 'civicrm_queue.id',
135 'table_name' => 'civicrm_queue',
137 'bao' => 'CRM_Queue_BAO_Queue',
147 'type' => CRM_Utils_Type
::T_STRING
,
148 'title' => ts('Name'),
149 'description' => ts('Name of the queue'),
152 'size' => CRM_Utils_Type
::BIG
,
153 'where' => 'civicrm_queue.name',
154 'table_name' => 'civicrm_queue',
156 'bao' => 'CRM_Queue_BAO_Queue',
165 'type' => CRM_Utils_Type
::T_STRING
,
166 'title' => ts('Type'),
167 'description' => ts('Type of the queue'),
170 'size' => CRM_Utils_Type
::BIG
,
171 'where' => 'civicrm_queue.type',
172 'table_name' => 'civicrm_queue',
174 'bao' => 'CRM_Queue_BAO_Queue',
179 'pseudoconstant' => [
180 'callback' => 'CRM_Queue_BAO_Queue::getTypes',
186 'type' => CRM_Utils_Type
::T_STRING
,
187 'title' => ts('Runner'),
188 'description' => ts('Name of the task runner'),
191 'size' => CRM_Utils_Type
::BIG
,
192 'where' => 'civicrm_queue.runner',
193 'table_name' => 'civicrm_queue',
195 'bao' => 'CRM_Queue_BAO_Queue',
203 'name' => 'batch_limit',
204 'type' => CRM_Utils_Type
::T_INT
,
205 'title' => ts('Batch Limit'),
206 'description' => ts('Maximum number of items in a batch.'),
208 'where' => 'civicrm_queue.batch_limit',
210 'table_name' => 'civicrm_queue',
212 'bao' => 'CRM_Queue_BAO_Queue',
220 'name' => 'lease_time',
221 'type' => CRM_Utils_Type
::T_INT
,
222 'title' => ts('Lease Time'),
223 'description' => ts('When claiming an item (or batch of items) for work, how long should the item(s) be reserved. (Seconds)'),
225 'where' => 'civicrm_queue.lease_time',
227 'table_name' => 'civicrm_queue',
229 'bao' => 'CRM_Queue_BAO_Queue',
237 'name' => 'retry_limit',
238 'type' => CRM_Utils_Type
::T_INT
,
239 'title' => ts('Retry Limit'),
240 'description' => ts('Number of permitted retries. Set to zero (0) to disable.'),
242 'where' => 'civicrm_queue.retry_limit',
244 'table_name' => 'civicrm_queue',
246 'bao' => 'CRM_Queue_BAO_Queue',
253 'retry_interval' => [
254 'name' => 'retry_interval',
255 'type' => CRM_Utils_Type
::T_INT
,
256 'title' => ts('Retry Interval'),
257 'description' => ts('Number of seconds to wait before retrying a failed execution.'),
259 'where' => 'civicrm_queue.retry_interval',
260 'table_name' => 'civicrm_queue',
262 'bao' => 'CRM_Queue_BAO_Queue',
270 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
272 return Civi
::$statics[__CLASS__
]['fields'];
276 * Return a mapping from field-name to the corresponding key (as used in fields()).
279 * Array(string $name => string $uniqueName).
281 public static function &fieldKeys() {
282 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
283 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
285 return Civi
::$statics[__CLASS__
]['fieldKeys'];
289 * Returns the names of this table
293 public static function getTableName() {
294 return self
::$_tableName;
298 * Returns if this table needs to be logged
302 public function getLog() {
307 * Returns the list of fields that can be imported
309 * @param bool $prefix
313 public static function &import($prefix = FALSE) {
314 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'queue', $prefix, []);
319 * Returns the list of fields that can be exported
321 * @param bool $prefix
325 public static function &export($prefix = FALSE) {
326 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'queue', $prefix, []);
331 * Returns the list of indices
333 * @param bool $localize
337 public static function indices($localize = TRUE) {
344 'localizable' => FALSE,
346 'sig' => 'civicrm_queue::1::name',
349 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;