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