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:08890bdce3ccfede0d5963b2a0a6fa98)
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;
53 * Should the standard background attempt to autorun tasks in this queue?
62 public function __construct() {
63 $this->__table
= 'civicrm_queue';
64 parent
::__construct();
68 * Returns localized title of this entity.
71 * Whether to return the plural version of the title.
73 public static function getEntityTitle($plural = FALSE) {
74 return $plural ?
ts('Queues') : ts('Queue');
78 * Returns all the column names of this table
82 public static function &fields() {
83 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
84 Civi
::$statics[__CLASS__
]['fields'] = [
87 'type' => CRM_Utils_Type
::T_INT
,
88 'title' => ts('System Queue ID'),
90 'where' => 'civicrm_queue.id',
91 'table_name' => 'civicrm_queue',
93 'bao' => 'CRM_Queue_BAO_Queue',
103 'type' => CRM_Utils_Type
::T_STRING
,
104 'title' => ts('Name'),
105 'description' => ts('Name of the queue'),
108 'size' => CRM_Utils_Type
::BIG
,
109 'where' => 'civicrm_queue.name',
110 'table_name' => 'civicrm_queue',
112 'bao' => 'CRM_Queue_BAO_Queue',
121 'type' => CRM_Utils_Type
::T_STRING
,
122 'title' => ts('Type'),
123 'description' => ts('Type of the queue'),
126 'size' => CRM_Utils_Type
::BIG
,
127 'where' => 'civicrm_queue.type',
128 'table_name' => 'civicrm_queue',
130 'bao' => 'CRM_Queue_BAO_Queue',
135 'pseudoconstant' => [
136 'callback' => 'CRM_Queue_BAO_Queue::getTypes',
141 'name' => 'is_autorun',
142 'type' => CRM_Utils_Type
::T_BOOLEAN
,
143 'title' => ts('Enable Autorun'),
144 'description' => ts('Should the standard background attempt to autorun tasks in this queue?'),
145 'where' => 'civicrm_queue.is_autorun',
146 'table_name' => 'civicrm_queue',
148 'bao' => 'CRM_Queue_BAO_Queue',
151 'type' => 'CheckBox',
152 'label' => ts("Auto Run"),
157 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
159 return Civi
::$statics[__CLASS__
]['fields'];
163 * Return a mapping from field-name to the corresponding key (as used in fields()).
166 * Array(string $name => string $uniqueName).
168 public static function &fieldKeys() {
169 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
170 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
172 return Civi
::$statics[__CLASS__
]['fieldKeys'];
176 * Returns the names of this table
180 public static function getTableName() {
181 return self
::$_tableName;
185 * Returns if this table needs to be logged
189 public function getLog() {
194 * Returns the list of fields that can be imported
196 * @param bool $prefix
200 public static function &import($prefix = FALSE) {
201 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'queue', $prefix, []);
206 * Returns the list of fields that can be exported
208 * @param bool $prefix
212 public static function &export($prefix = FALSE) {
213 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'queue', $prefix, []);
218 * Returns the list of indices
220 * @param bool $localize
224 public static function indices($localize = TRUE) {
231 'localizable' => FALSE,
233 'sig' => 'civicrm_queue::1::name',
236 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;