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:5a49f8a2765460d48e4266efa9d447f2)
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 * Should the standard background attempt to autorun tasks in this queue?
61 * @var bool|string|null
63 * Note that values will be retrieved from the database as a string.
70 public function __construct() {
71 $this->__table
= 'civicrm_queue';
72 parent
::__construct();
76 * Returns localized title of this entity.
79 * Whether to return the plural version of the title.
81 public static function getEntityTitle($plural = FALSE) {
82 return $plural ?
ts('Queues') : ts('Queue');
86 * Returns all the column names of this table
90 public static function &fields() {
91 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
92 Civi
::$statics[__CLASS__
]['fields'] = [
95 'type' => CRM_Utils_Type
::T_INT
,
96 'title' => ts('System Queue ID'),
98 'where' => 'civicrm_queue.id',
99 'table_name' => 'civicrm_queue',
101 'bao' => 'CRM_Queue_BAO_Queue',
111 'type' => CRM_Utils_Type
::T_STRING
,
112 'title' => ts('Name'),
113 'description' => ts('Name of the queue'),
116 'size' => CRM_Utils_Type
::BIG
,
117 'where' => 'civicrm_queue.name',
118 'table_name' => 'civicrm_queue',
120 'bao' => 'CRM_Queue_BAO_Queue',
129 'type' => CRM_Utils_Type
::T_STRING
,
130 'title' => ts('Type'),
131 'description' => ts('Type of the queue'),
134 'size' => CRM_Utils_Type
::BIG
,
135 'where' => 'civicrm_queue.type',
136 'table_name' => 'civicrm_queue',
138 'bao' => 'CRM_Queue_BAO_Queue',
143 'pseudoconstant' => [
144 'callback' => 'CRM_Queue_BAO_Queue::getTypes',
149 'name' => 'is_autorun',
150 'type' => CRM_Utils_Type
::T_BOOLEAN
,
151 'title' => ts('Enable Autorun'),
152 'description' => ts('Should the standard background attempt to autorun tasks in this queue?'),
153 'where' => 'civicrm_queue.is_autorun',
154 'table_name' => 'civicrm_queue',
156 'bao' => 'CRM_Queue_BAO_Queue',
159 'type' => 'CheckBox',
160 'label' => ts("Auto Run"),
165 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
167 return Civi
::$statics[__CLASS__
]['fields'];
171 * Return a mapping from field-name to the corresponding key (as used in fields()).
174 * Array(string $name => string $uniqueName).
176 public static function &fieldKeys() {
177 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
178 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
180 return Civi
::$statics[__CLASS__
]['fieldKeys'];
184 * Returns the names of this table
188 public static function getTableName() {
189 return self
::$_tableName;
193 * Returns if this table needs to be logged
197 public function getLog() {
202 * Returns the list of fields that can be imported
204 * @param bool $prefix
208 public static function &import($prefix = FALSE) {
209 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'queue', $prefix, []);
214 * Returns the list of fields that can be exported
216 * @param bool $prefix
220 public static function &export($prefix = FALSE) {
221 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'queue', $prefix, []);
226 * Returns the list of indices
228 * @param bool $localize
232 public static function indices($localize = TRUE) {
239 'localizable' => FALSE,
241 'sig' => 'civicrm_queue::1::name',
244 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;