Commit | Line | Data |
---|---|---|
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 | |
c1e814c7 | 9 | * (GenCodeChecksum:ed0f2b22eb6983f73fa5b87fc4fa7c9c) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the ParticipantStatusType entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class 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 | * | |
c1e814c7 | 73 | * @var bool|string |
28979d65 CW |
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 | * | |
c1e814c7 | 82 | * @var bool|string |
28979d65 CW |
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 | * | |
c1e814c7 | 91 | * @var bool|string |
28979d65 CW |
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'), |
c1e814c7 | 213 | 'required' => TRUE, |
a36434b9 | 214 | 'where' => 'civicrm_participant_status_type.is_reserved', |
c1e814c7 | 215 | 'default' => '0', |
522a26c9 | 216 | 'table_name' => 'civicrm_participant_status_type', |
217 | 'entity' => 'ParticipantStatusType', | |
218 | 'bao' => 'CRM_Event_BAO_ParticipantStatusType', | |
6a7e5e5d | 219 | 'localizable' => 0, |
a9d0587b | 220 | 'add' => '3.0', |
c3fc2621 CW |
221 | ], |
222 | 'is_active' => [ | |
e501603b TO |
223 | 'name' => 'is_active', |
224 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 225 | 'title' => ts('Participant Status is Active'), |
215b423e | 226 | 'description' => ts('whether this status type is active'), |
c1e814c7 | 227 | 'required' => TRUE, |
a36434b9 | 228 | 'where' => 'civicrm_participant_status_type.is_active', |
e501603b | 229 | 'default' => '1', |
522a26c9 | 230 | 'table_name' => 'civicrm_participant_status_type', |
231 | 'entity' => 'ParticipantStatusType', | |
232 | 'bao' => 'CRM_Event_BAO_ParticipantStatusType', | |
6a7e5e5d | 233 | 'localizable' => 0, |
a9d0587b | 234 | 'add' => '3.0', |
c3fc2621 CW |
235 | ], |
236 | 'is_counted' => [ | |
e501603b TO |
237 | 'name' => 'is_counted', |
238 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 239 | 'title' => ts('Participant Status Counts?'), |
215b423e | 240 | 'description' => ts('whether this status type is counted against event size limit'), |
c1e814c7 | 241 | 'required' => TRUE, |
a36434b9 | 242 | 'where' => 'civicrm_participant_status_type.is_counted', |
c1e814c7 | 243 | 'default' => '0', |
522a26c9 | 244 | 'table_name' => 'civicrm_participant_status_type', |
245 | 'entity' => 'ParticipantStatusType', | |
246 | 'bao' => 'CRM_Event_BAO_ParticipantStatusType', | |
6a7e5e5d | 247 | 'localizable' => 0, |
a9d0587b | 248 | 'add' => '3.0', |
c3fc2621 CW |
249 | ], |
250 | 'weight' => [ | |
e501603b TO |
251 | 'name' => 'weight', |
252 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 253 | 'title' => ts('Order'), |
215b423e | 254 | 'description' => ts('controls sort order'), |
c3fc2621 | 255 | 'required' => TRUE, |
a36434b9 | 256 | 'where' => 'civicrm_participant_status_type.weight', |
522a26c9 | 257 | 'table_name' => 'civicrm_participant_status_type', |
258 | 'entity' => 'ParticipantStatusType', | |
259 | 'bao' => 'CRM_Event_BAO_ParticipantStatusType', | |
6a7e5e5d | 260 | 'localizable' => 0, |
a9d0587b | 261 | 'add' => '3.0', |
c3fc2621 CW |
262 | ], |
263 | 'visibility_id' => [ | |
e501603b TO |
264 | 'name' => 'visibility_id', |
265 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 266 | 'title' => ts('Participant Status Visibility'), |
215b423e | 267 | '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 | 268 | 'where' => 'civicrm_participant_status_type.visibility_id', |
522a26c9 | 269 | 'table_name' => 'civicrm_participant_status_type', |
270 | 'entity' => 'ParticipantStatusType', | |
271 | 'bao' => 'CRM_Event_BAO_ParticipantStatusType', | |
6a7e5e5d | 272 | 'localizable' => 0, |
c3fc2621 | 273 | 'html' => [ |
e501603b | 274 | 'type' => 'Select', |
c3fc2621 CW |
275 | ], |
276 | 'pseudoconstant' => [ | |
e501603b TO |
277 | 'optionGroupName' => 'visibility', |
278 | 'optionEditPath' => 'civicrm/admin/options/visibility', | |
e6ca0a57 | 279 | ], |
a9d0587b | 280 | 'add' => '3.0', |
c3fc2621 CW |
281 | ], |
282 | ]; | |
346aaaba | 283 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 284 | } |
346aaaba | 285 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 286 | } |
c3fc2621 | 287 | |
e501603b | 288 | /** |
bd8e0b14 | 289 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
290 | * |
291 | * @return array | |
bd8e0b14 | 292 | * Array(string $name => string $uniqueName). |
e501603b | 293 | */ |
c3fc2621 | 294 | public static function &fieldKeys() { |
bd8e0b14 TO |
295 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
296 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 297 | } |
bd8e0b14 | 298 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 299 | } |
c3fc2621 | 300 | |
e501603b TO |
301 | /** |
302 | * Returns the names of this table | |
303 | * | |
304 | * @return string | |
305 | */ | |
c3fc2621 | 306 | public static function getTableName() { |
e501603b TO |
307 | return CRM_Core_DAO::getLocaleTableName(self::$_tableName); |
308 | } | |
c3fc2621 | 309 | |
e501603b TO |
310 | /** |
311 | * Returns if this table needs to be logged | |
312 | * | |
c3fc2621 | 313 | * @return bool |
e501603b | 314 | */ |
c3fc2621 | 315 | public function getLog() { |
e501603b TO |
316 | return self::$_log; |
317 | } | |
c3fc2621 | 318 | |
e501603b TO |
319 | /** |
320 | * Returns the list of fields that can be imported | |
321 | * | |
322 | * @param bool $prefix | |
323 | * | |
324 | * @return array | |
325 | */ | |
c3fc2621 CW |
326 | public static function &import($prefix = FALSE) { |
327 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'participant_status_type', $prefix, []); | |
60808919 | 328 | return $r; |
e501603b | 329 | } |
c3fc2621 | 330 | |
e501603b TO |
331 | /** |
332 | * Returns the list of fields that can be exported | |
333 | * | |
334 | * @param bool $prefix | |
335 | * | |
336 | * @return array | |
337 | */ | |
c3fc2621 CW |
338 | public static function &export($prefix = FALSE) { |
339 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'participant_status_type', $prefix, []); | |
60808919 | 340 | return $r; |
e501603b | 341 | } |
c3fc2621 | 342 | |
e7a6b91a AS |
343 | /** |
344 | * Returns the list of indices | |
c3fc2621 CW |
345 | * |
346 | * @param bool $localize | |
347 | * | |
348 | * @return array | |
e7a6b91a AS |
349 | */ |
350 | public static function indices($localize = TRUE) { | |
c3fc2621 | 351 | $indices = []; |
e7a6b91a AS |
352 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
353 | } | |
c3fc2621 | 354 | |
e501603b | 355 | } |