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