Merge pull request #19727 from totten/master-authx-rest
[civicrm-core.git] / CRM / Event / DAO / ParticipantStatusType.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
ca5cec67 5 * @copyright CiviCRM LLC https://civicrm.org/licensing
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Event/ParticipantStatusType.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
28979d65 9 * (GenCodeChecksum:bb9ea5411d4ab4f767d891f2e0f20858)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the ParticipantStatusType entity.
f41f0342 14 */
e501603b 15class CRM_Event_DAO_ParticipantStatusType extends CRM_Core_DAO {
929a1c14
CW
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '3.0';
d31fb4e3 18 const COMPONENT = 'CiviEvent';
c3fc2621 19
e501603b 20 /**
f41f0342 21 * Static instance to hold the table name.
e501603b
TO
22 *
23 * @var string
24 */
fa45b5b9 25 public static $_tableName = 'civicrm_participant_status_type';
c3fc2621 26
e501603b 27 /**
f41f0342 28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 29 *
c3fc2621 30 * @var bool
e501603b 31 */
fa45b5b9 32 public static $_log = TRUE;
c3fc2621 33
e501603b
TO
34 /**
35 * unique participant status type id
36 *
28979d65
CW
37 * @var int|string|null
38 * (SQL type: int unsigned)
39 * Note that values will be retrieved from the database as a string.
e501603b
TO
40 */
41 public $id;
c3fc2621 42
e501603b
TO
43 /**
44 * non-localized name of the status type
45 *
28979d65
CW
46 * @var string|null
47 * (SQL type: varchar(64))
48 * Note that values will be retrieved from the database as a string.
e501603b
TO
49 */
50 public $name;
c3fc2621 51
e501603b
TO
52 /**
53 * localized label for display of this status type
54 *
28979d65
CW
55 * @var string|null
56 * (SQL type: varchar(255))
57 * Note that values will be retrieved from the database as a string.
e501603b
TO
58 */
59 public $label;
c3fc2621 60
e501603b
TO
61 /**
62 * the general group of status type this one belongs to
63 *
28979d65
CW
64 * @var string|null
65 * (SQL type: varchar(8))
66 * Note that values will be retrieved from the database as a string.
e501603b
TO
67 */
68 public $class;
c3fc2621 69
e501603b
TO
70 /**
71 * whether this is a status type required by the system
72 *
28979d65
CW
73 * @var bool|string|null
74 * (SQL type: tinyint)
75 * Note that values will be retrieved from the database as a string.
e501603b
TO
76 */
77 public $is_reserved;
c3fc2621 78
e501603b
TO
79 /**
80 * whether this status type is active
81 *
28979d65
CW
82 * @var bool|string|null
83 * (SQL type: tinyint)
84 * Note that values will be retrieved from the database as a string.
e501603b
TO
85 */
86 public $is_active;
c3fc2621 87
e501603b
TO
88 /**
89 * whether this status type is counted against event size limit
90 *
28979d65
CW
91 * @var bool|string|null
92 * (SQL type: tinyint)
93 * Note that values will be retrieved from the database as a string.
e501603b
TO
94 */
95 public $is_counted;
c3fc2621 96
e501603b
TO
97 /**
98 * controls sort order
99 *
28979d65
CW
100 * @var int|string
101 * (SQL type: int unsigned)
102 * Note that values will be retrieved from the database as a string.
e501603b
TO
103 */
104 public $weight;
c3fc2621 105
e501603b
TO
106 /**
107 * whether the status type is visible to the public, an implicit foreign key to option_value.value related to the `visibility` option_group
108 *
28979d65
CW
109 * @var int|string|null
110 * (SQL type: int unsigned)
111 * Note that values will be retrieved from the database as a string.
e501603b
TO
112 */
113 public $visibility_id;
c3fc2621 114
e501603b 115 /**
f41f0342 116 * Class constructor.
e501603b 117 */
c3fc2621 118 public function __construct() {
e501603b
TO
119 $this->__table = 'civicrm_participant_status_type';
120 parent::__construct();
121 }
c3fc2621 122
449c4e6b
CW
123 /**
124 * Returns localized title of this entity.
7b66c3b5
AH
125 *
126 * @param bool $plural
127 * Whether to return the plural version of the title.
449c4e6b 128 */
7b66c3b5
AH
129 public static function getEntityTitle($plural = FALSE) {
130 return $plural ? ts('Participant Status Types') : ts('Participant Status Type');
449c4e6b
CW
131 }
132
e501603b
TO
133 /**
134 * Returns all the column names of this table
135 *
136 * @return array
137 */
c3fc2621 138 public static function &fields() {
346aaaba 139 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
140 Civi::$statics[__CLASS__]['fields'] = [
141 'id' => [
e501603b
TO
142 'name' => 'id',
143 'type' => CRM_Utils_Type::T_INT,
c3fc2621 144 'title' => ts('Participant Status Type ID'),
215b423e 145 'description' => ts('unique participant status type id'),
c3fc2621 146 'required' => TRUE,
a36434b9 147 'where' => 'civicrm_participant_status_type.id',
522a26c9 148 'table_name' => 'civicrm_participant_status_type',
149 'entity' => 'ParticipantStatusType',
150 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
6a7e5e5d 151 'localizable' => 0,
2cbbebe8
A
152 'html' => [
153 'type' => 'Number',
154 ],
1fe423d6 155 'readonly' => TRUE,
a9d0587b 156 'add' => '3.0',
c3fc2621
CW
157 ],
158 'participant_status' => [
e501603b
TO
159 'name' => 'name',
160 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 161 'title' => ts('Participant Status'),
215b423e 162 'description' => ts('non-localized name of the status type'),
e501603b
TO
163 'maxlength' => 64,
164 'size' => CRM_Utils_Type::BIG,
c3fc2621 165 'import' => TRUE,
e501603b 166 'where' => 'civicrm_participant_status_type.name',
c3fc2621 167 'export' => TRUE,
522a26c9 168 'table_name' => 'civicrm_participant_status_type',
169 'entity' => 'ParticipantStatusType',
170 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
6a7e5e5d 171 'localizable' => 0,
a9d0587b 172 'add' => '3.0',
c3fc2621
CW
173 ],
174 'label' => [
e501603b
TO
175 'name' => 'label',
176 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 177 'title' => ts('Participant Status Label'),
215b423e 178 'description' => ts('localized label for display of this status type'),
e501603b
TO
179 'maxlength' => 255,
180 'size' => CRM_Utils_Type::HUGE,
a36434b9 181 'where' => 'civicrm_participant_status_type.label',
522a26c9 182 'table_name' => 'civicrm_participant_status_type',
183 'entity' => 'ParticipantStatusType',
184 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
6a7e5e5d 185 'localizable' => 1,
a9d0587b 186 'add' => '3.0',
c3fc2621
CW
187 ],
188 'class' => [
e501603b
TO
189 'name' => 'class',
190 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 191 'title' => ts('Participant Status Class'),
215b423e 192 'description' => ts('the general group of status type this one belongs to'),
e501603b
TO
193 'maxlength' => 8,
194 'size' => CRM_Utils_Type::EIGHT,
a36434b9 195 'where' => 'civicrm_participant_status_type.class',
522a26c9 196 'table_name' => 'civicrm_participant_status_type',
197 'entity' => 'ParticipantStatusType',
198 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
6a7e5e5d 199 'localizable' => 0,
c3fc2621 200 'html' => [
e501603b 201 'type' => 'Select',
c3fc2621
CW
202 ],
203 'pseudoconstant' => [
e501603b 204 'callback' => 'CRM_Event_PseudoConstant::participantStatusClassOptions',
e6ca0a57 205 ],
a9d0587b 206 'add' => '3.0',
c3fc2621
CW
207 ],
208 'is_reserved' => [
e501603b
TO
209 'name' => 'is_reserved',
210 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 211 'title' => ts('Participant Status Is Reserved?>'),
215b423e 212 'description' => ts('whether this is a status type required by the system'),
a36434b9 213 'where' => 'civicrm_participant_status_type.is_reserved',
522a26c9 214 'table_name' => 'civicrm_participant_status_type',
215 'entity' => 'ParticipantStatusType',
216 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
6a7e5e5d 217 'localizable' => 0,
a9d0587b 218 'add' => '3.0',
c3fc2621
CW
219 ],
220 'is_active' => [
e501603b
TO
221 'name' => 'is_active',
222 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 223 'title' => ts('Participant Status is Active'),
215b423e 224 'description' => ts('whether this status type is active'),
a36434b9 225 'where' => 'civicrm_participant_status_type.is_active',
e501603b 226 'default' => '1',
522a26c9 227 'table_name' => 'civicrm_participant_status_type',
228 'entity' => 'ParticipantStatusType',
229 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
6a7e5e5d 230 'localizable' => 0,
a9d0587b 231 'add' => '3.0',
c3fc2621
CW
232 ],
233 'is_counted' => [
e501603b
TO
234 'name' => 'is_counted',
235 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 236 'title' => ts('Participant Status Counts?'),
215b423e 237 'description' => ts('whether this status type is counted against event size limit'),
a36434b9 238 'where' => 'civicrm_participant_status_type.is_counted',
522a26c9 239 'table_name' => 'civicrm_participant_status_type',
240 'entity' => 'ParticipantStatusType',
241 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
6a7e5e5d 242 'localizable' => 0,
a9d0587b 243 'add' => '3.0',
c3fc2621
CW
244 ],
245 'weight' => [
e501603b
TO
246 'name' => 'weight',
247 'type' => CRM_Utils_Type::T_INT,
c3fc2621 248 'title' => ts('Order'),
215b423e 249 'description' => ts('controls sort order'),
c3fc2621 250 'required' => TRUE,
a36434b9 251 'where' => 'civicrm_participant_status_type.weight',
522a26c9 252 'table_name' => 'civicrm_participant_status_type',
253 'entity' => 'ParticipantStatusType',
254 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
6a7e5e5d 255 'localizable' => 0,
a9d0587b 256 'add' => '3.0',
c3fc2621
CW
257 ],
258 'visibility_id' => [
e501603b
TO
259 'name' => 'visibility_id',
260 'type' => CRM_Utils_Type::T_INT,
c3fc2621 261 'title' => ts('Participant Status Visibility'),
215b423e 262 'description' => ts('whether the status type is visible to the public, an implicit foreign key to option_value.value related to the `visibility` option_group'),
a36434b9 263 'where' => 'civicrm_participant_status_type.visibility_id',
522a26c9 264 'table_name' => 'civicrm_participant_status_type',
265 'entity' => 'ParticipantStatusType',
266 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
6a7e5e5d 267 'localizable' => 0,
c3fc2621 268 'html' => [
e501603b 269 'type' => 'Select',
c3fc2621
CW
270 ],
271 'pseudoconstant' => [
e501603b
TO
272 'optionGroupName' => 'visibility',
273 'optionEditPath' => 'civicrm/admin/options/visibility',
e6ca0a57 274 ],
a9d0587b 275 'add' => '3.0',
c3fc2621
CW
276 ],
277 ];
346aaaba 278 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 279 }
346aaaba 280 return Civi::$statics[__CLASS__]['fields'];
e501603b 281 }
c3fc2621 282
e501603b 283 /**
bd8e0b14 284 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
285 *
286 * @return array
bd8e0b14 287 * Array(string $name => string $uniqueName).
e501603b 288 */
c3fc2621 289 public static function &fieldKeys() {
bd8e0b14
TO
290 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
291 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 292 }
bd8e0b14 293 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 294 }
c3fc2621 295
e501603b
TO
296 /**
297 * Returns the names of this table
298 *
299 * @return string
300 */
c3fc2621 301 public static function getTableName() {
e501603b
TO
302 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
303 }
c3fc2621 304
e501603b
TO
305 /**
306 * Returns if this table needs to be logged
307 *
c3fc2621 308 * @return bool
e501603b 309 */
c3fc2621 310 public function getLog() {
e501603b
TO
311 return self::$_log;
312 }
c3fc2621 313
e501603b
TO
314 /**
315 * Returns the list of fields that can be imported
316 *
317 * @param bool $prefix
318 *
319 * @return array
320 */
c3fc2621
CW
321 public static function &import($prefix = FALSE) {
322 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'participant_status_type', $prefix, []);
60808919 323 return $r;
e501603b 324 }
c3fc2621 325
e501603b
TO
326 /**
327 * Returns the list of fields that can be exported
328 *
329 * @param bool $prefix
330 *
331 * @return array
332 */
c3fc2621
CW
333 public static function &export($prefix = FALSE) {
334 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'participant_status_type', $prefix, []);
60808919 335 return $r;
e501603b 336 }
c3fc2621 337
e7a6b91a
AS
338 /**
339 * Returns the list of indices
c3fc2621
CW
340 *
341 * @param bool $localize
342 *
343 * @return array
e7a6b91a
AS
344 */
345 public static function indices($localize = TRUE) {
c3fc2621 346 $indices = [];
e7a6b91a
AS
347 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
348 }
c3fc2621 349
e501603b 350}