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/Participant.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
a9d0587b | 9 | * (GenCodeChecksum:5ae3aa69ac3d004f649038adbf993b8b) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the Participant entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Event_DAO_Participant 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'; |
c3fc2621 | 23 | |
449c4e6b CW |
24 | /** |
25 | * Icon associated with this entity. | |
26 | * | |
27 | * @var string | |
28 | */ | |
29 | public static $_icon = 'fa-ticket'; | |
30 | ||
e501603b | 31 | /** |
f41f0342 | 32 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 33 | * |
c3fc2621 | 34 | * @var bool |
e501603b | 35 | */ |
fa45b5b9 | 36 | public static $_log = TRUE; |
c3fc2621 | 37 | |
e501603b TO |
38 | /** |
39 | * Participant Id | |
40 | * | |
e6ca0a57 | 41 | * @var int |
e501603b TO |
42 | */ |
43 | public $id; | |
c3fc2621 | 44 | |
e501603b TO |
45 | /** |
46 | * FK to Contact ID | |
47 | * | |
e6ca0a57 | 48 | * @var int |
e501603b TO |
49 | */ |
50 | public $contact_id; | |
c3fc2621 | 51 | |
e501603b TO |
52 | /** |
53 | * FK to Event ID | |
54 | * | |
e6ca0a57 | 55 | * @var int |
e501603b TO |
56 | */ |
57 | public $event_id; | |
c3fc2621 | 58 | |
e501603b TO |
59 | /** |
60 | * Participant status ID. FK to civicrm_participant_status_type. Default of 1 should map to status = Registered. | |
61 | * | |
e6ca0a57 | 62 | * @var int |
e501603b TO |
63 | */ |
64 | public $status_id; | |
c3fc2621 | 65 | |
e501603b TO |
66 | /** |
67 | * Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role. | |
68 | * | |
69 | * @var string | |
70 | */ | |
71 | public $role_id; | |
c3fc2621 | 72 | |
e501603b TO |
73 | /** |
74 | * When did contact register for event? | |
75 | * | |
76 | * @var datetime | |
77 | */ | |
78 | public $register_date; | |
c3fc2621 | 79 | |
e501603b TO |
80 | /** |
81 | * Source of this event registration. | |
82 | * | |
83 | * @var string | |
84 | */ | |
85 | public $source; | |
c3fc2621 | 86 | |
e501603b TO |
87 | /** |
88 | * Populate with the label (text) associated with a fee level for paid events with multiple levels. Note that | |
fb607354 | 89 | * we store the label value and not the key |
e501603b | 90 | * |
a21be570 | 91 | * @var text |
e501603b TO |
92 | */ |
93 | public $fee_level; | |
c3fc2621 | 94 | |
e501603b | 95 | /** |
e6ca0a57 | 96 | * @var bool |
e501603b TO |
97 | */ |
98 | public $is_test; | |
c3fc2621 | 99 | |
e501603b | 100 | /** |
e6ca0a57 | 101 | * @var bool |
e501603b TO |
102 | */ |
103 | public $is_pay_later; | |
c3fc2621 | 104 | |
e501603b TO |
105 | /** |
106 | * actual processor fee if known - may be 0. | |
107 | * | |
108 | * @var float | |
109 | */ | |
110 | public $fee_amount; | |
c3fc2621 | 111 | |
e501603b TO |
112 | /** |
113 | * FK to Participant ID | |
114 | * | |
e6ca0a57 | 115 | * @var int |
e501603b TO |
116 | */ |
117 | public $registered_by_id; | |
c3fc2621 | 118 | |
e501603b TO |
119 | /** |
120 | * FK to Discount ID | |
121 | * | |
e6ca0a57 | 122 | * @var int |
e501603b TO |
123 | */ |
124 | public $discount_id; | |
c3fc2621 | 125 | |
e501603b TO |
126 | /** |
127 | * 3 character string, value derived from config setting. | |
128 | * | |
129 | * @var string | |
130 | */ | |
131 | public $fee_currency; | |
c3fc2621 | 132 | |
e501603b TO |
133 | /** |
134 | * The campaign for which this participant has been registered. | |
135 | * | |
e6ca0a57 | 136 | * @var int |
e501603b TO |
137 | */ |
138 | public $campaign_id; | |
c3fc2621 | 139 | |
e501603b TO |
140 | /** |
141 | * Discount Amount | |
142 | * | |
e6ca0a57 | 143 | * @var int |
e501603b TO |
144 | */ |
145 | public $discount_amount; | |
c3fc2621 | 146 | |
e501603b TO |
147 | /** |
148 | * FK to civicrm_event_carts | |
149 | * | |
e6ca0a57 | 150 | * @var int |
e501603b TO |
151 | */ |
152 | public $cart_id; | |
c3fc2621 | 153 | |
e501603b TO |
154 | /** |
155 | * On Waiting List | |
156 | * | |
157 | * @var int | |
158 | */ | |
159 | public $must_wait; | |
c3fc2621 | 160 | |
e501603b TO |
161 | /** |
162 | * FK to Contact ID | |
163 | * | |
e6ca0a57 | 164 | * @var int |
e501603b TO |
165 | */ |
166 | public $transferred_to_contact_id; | |
c3fc2621 | 167 | |
e501603b | 168 | /** |
f41f0342 | 169 | * Class constructor. |
e501603b | 170 | */ |
c3fc2621 | 171 | public function __construct() { |
e501603b TO |
172 | $this->__table = 'civicrm_participant'; |
173 | parent::__construct(); | |
174 | } | |
c3fc2621 | 175 | |
449c4e6b CW |
176 | /** |
177 | * Returns localized title of this entity. | |
178 | */ | |
179 | public static function getEntityTitle() { | |
180 | return ts('Participants'); | |
181 | } | |
182 | ||
e501603b | 183 | /** |
f41f0342 | 184 | * Returns foreign keys and entity references. |
e501603b TO |
185 | * |
186 | * @return array | |
187 | * [CRM_Core_Reference_Interface] | |
188 | */ | |
c3fc2621 | 189 | public static function getReferenceColumns() { |
346aaaba | 190 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
fa45b5b9 | 191 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 CW |
192 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id'); |
193 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_id', 'civicrm_event', 'id'); | |
194 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'status_id', 'civicrm_participant_status_type', 'id'); | |
195 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'registered_by_id', 'civicrm_participant', 'id'); | |
196 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'discount_id', 'civicrm_discount', 'id'); | |
197 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'campaign_id', 'civicrm_campaign', 'id'); | |
198 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'cart_id', 'civicrm_event_carts', 'id'); | |
199 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'transferred_to_contact_id', 'civicrm_contact', 'id'); | |
346aaaba | 200 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 201 | } |
346aaaba | 202 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 203 | } |
c3fc2621 | 204 | |
e501603b TO |
205 | /** |
206 | * Returns all the column names of this table | |
207 | * | |
208 | * @return array | |
209 | */ | |
c3fc2621 | 210 | public static function &fields() { |
346aaaba | 211 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
212 | Civi::$statics[__CLASS__]['fields'] = [ |
213 | 'participant_id' => [ | |
e501603b TO |
214 | 'name' => 'id', |
215 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 216 | 'title' => ts('Participant ID'), |
215b423e | 217 | 'description' => ts('Participant Id'), |
c3fc2621 CW |
218 | 'required' => TRUE, |
219 | 'import' => TRUE, | |
e501603b TO |
220 | 'where' => 'civicrm_participant.id', |
221 | 'headerPattern' => '/(^(participant(.)?)?id$)/i', | |
c3fc2621 | 222 | 'export' => TRUE, |
522a26c9 | 223 | 'table_name' => 'civicrm_participant', |
224 | 'entity' => 'Participant', | |
225 | 'bao' => 'CRM_Event_BAO_Participant', | |
6a7e5e5d | 226 | 'localizable' => 0, |
a9d0587b | 227 | 'add' => '1.7', |
c3fc2621 CW |
228 | ], |
229 | 'participant_contact_id' => [ | |
e501603b TO |
230 | 'name' => 'contact_id', |
231 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 232 | 'title' => ts('Contact ID'), |
215b423e | 233 | 'description' => ts('FK to Contact ID'), |
c3fc2621 CW |
234 | 'required' => TRUE, |
235 | 'import' => TRUE, | |
e501603b TO |
236 | 'where' => 'civicrm_participant.contact_id', |
237 | 'headerPattern' => '/contact(.?id)?/i', | |
c3fc2621 | 238 | 'export' => TRUE, |
522a26c9 | 239 | 'table_name' => 'civicrm_participant', |
240 | 'entity' => 'Participant', | |
241 | 'bao' => 'CRM_Event_BAO_Participant', | |
6a7e5e5d | 242 | 'localizable' => 0, |
e501603b | 243 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
a9d0587b | 244 | 'add' => '1.7', |
c3fc2621 CW |
245 | ], |
246 | 'event_id' => [ | |
e501603b TO |
247 | 'name' => 'event_id', |
248 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 249 | 'title' => ts('Event'), |
215b423e | 250 | 'description' => ts('FK to Event ID'), |
c3fc2621 CW |
251 | 'required' => TRUE, |
252 | 'import' => TRUE, | |
e501603b TO |
253 | 'where' => 'civicrm_participant.event_id', |
254 | 'headerPattern' => '/event id$/i', | |
c3fc2621 | 255 | 'export' => TRUE, |
522a26c9 | 256 | 'table_name' => 'civicrm_participant', |
257 | 'entity' => 'Participant', | |
258 | 'bao' => 'CRM_Event_BAO_Participant', | |
6a7e5e5d | 259 | 'localizable' => 0, |
e501603b | 260 | 'FKClassName' => 'CRM_Event_DAO_Event', |
a9d0587b | 261 | 'add' => '1.7', |
c3fc2621 CW |
262 | ], |
263 | 'participant_status_id' => [ | |
e501603b TO |
264 | 'name' => 'status_id', |
265 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 266 | 'title' => ts('Participant Status'), |
215b423e | 267 | 'description' => ts('Participant status ID. FK to civicrm_participant_status_type. Default of 1 should map to status = Registered.'), |
c3fc2621 CW |
268 | 'required' => TRUE, |
269 | 'import' => TRUE, | |
e501603b TO |
270 | 'where' => 'civicrm_participant.status_id', |
271 | 'headerPattern' => '/(participant.)?(status)$/i', | |
c3fc2621 | 272 | 'export' => TRUE, |
e501603b | 273 | 'default' => '1', |
522a26c9 | 274 | 'table_name' => 'civicrm_participant', |
275 | 'entity' => 'Participant', | |
276 | 'bao' => 'CRM_Event_BAO_Participant', | |
6a7e5e5d | 277 | 'localizable' => 0, |
e501603b | 278 | 'FKClassName' => 'CRM_Event_DAO_ParticipantStatusType', |
c3fc2621 | 279 | 'html' => [ |
e501603b | 280 | 'type' => 'Select', |
c3fc2621 CW |
281 | ], |
282 | 'pseudoconstant' => [ | |
e501603b TO |
283 | 'table' => 'civicrm_participant_status_type', |
284 | 'keyColumn' => 'id', | |
285 | 'labelColumn' => 'label', | |
e6ca0a57 | 286 | ], |
a9d0587b | 287 | 'add' => '1.7', |
c3fc2621 CW |
288 | ], |
289 | 'participant_role_id' => [ | |
e501603b TO |
290 | 'name' => 'role_id', |
291 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 292 | 'title' => ts('Participant Role'), |
215b423e | 293 | 'description' => ts('Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.'), |
e501603b TO |
294 | 'maxlength' => 128, |
295 | 'size' => CRM_Utils_Type::HUGE, | |
c3fc2621 | 296 | 'import' => TRUE, |
e501603b TO |
297 | 'where' => 'civicrm_participant.role_id', |
298 | 'headerPattern' => '/(participant.)?(role)$/i', | |
c3fc2621 | 299 | 'export' => TRUE, |
e501603b | 300 | 'default' => 'NULL', |
522a26c9 | 301 | 'table_name' => 'civicrm_participant', |
302 | 'entity' => 'Participant', | |
303 | 'bao' => 'CRM_Event_BAO_Participant', | |
6a7e5e5d | 304 | 'localizable' => 0, |
2a5c9b4d | 305 | 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED, |
c3fc2621 | 306 | 'html' => [ |
e501603b | 307 | 'type' => 'Select', |
c3fc2621 CW |
308 | ], |
309 | 'pseudoconstant' => [ | |
e501603b TO |
310 | 'optionGroupName' => 'participant_role', |
311 | 'optionEditPath' => 'civicrm/admin/options/participant_role', | |
e6ca0a57 | 312 | ], |
a9d0587b | 313 | 'add' => '1.7', |
c3fc2621 CW |
314 | ], |
315 | 'participant_register_date' => [ | |
e501603b TO |
316 | 'name' => 'register_date', |
317 | 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, | |
c3fc2621 | 318 | 'title' => ts('Register date'), |
215b423e | 319 | 'description' => ts('When did contact register for event?'), |
c3fc2621 | 320 | 'import' => TRUE, |
e501603b TO |
321 | 'where' => 'civicrm_participant.register_date', |
322 | 'headerPattern' => '/^(r(egister\s)?date)$/i', | |
c3fc2621 | 323 | 'export' => TRUE, |
522a26c9 | 324 | 'table_name' => 'civicrm_participant', |
325 | 'entity' => 'Participant', | |
326 | 'bao' => 'CRM_Event_BAO_Participant', | |
6a7e5e5d | 327 | 'localizable' => 0, |
c3fc2621 | 328 | 'html' => [ |
522a26c9 | 329 | 'type' => 'Select Date', |
24317d89 | 330 | 'formatType' => 'activityDateTime', |
c3fc2621 | 331 | ], |
a9d0587b | 332 | 'add' => '1.7', |
c3fc2621 CW |
333 | ], |
334 | 'participant_source' => [ | |
e501603b TO |
335 | 'name' => 'source', |
336 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 337 | 'title' => ts('Participant Source'), |
215b423e | 338 | 'description' => ts('Source of this event registration.'), |
e501603b TO |
339 | 'maxlength' => 128, |
340 | 'size' => CRM_Utils_Type::HUGE, | |
c3fc2621 | 341 | 'import' => TRUE, |
e501603b TO |
342 | 'where' => 'civicrm_participant.source', |
343 | 'headerPattern' => '/(participant.)?(source)$/i', | |
c3fc2621 | 344 | 'export' => TRUE, |
522a26c9 | 345 | 'table_name' => 'civicrm_participant', |
346 | 'entity' => 'Participant', | |
347 | 'bao' => 'CRM_Event_BAO_Participant', | |
6a7e5e5d | 348 | 'localizable' => 0, |
c1a6d6ac SL |
349 | 'html' => [ |
350 | 'type' => 'Text', | |
351 | ], | |
a9d0587b | 352 | 'add' => '1.7', |
c3fc2621 CW |
353 | ], |
354 | 'participant_fee_level' => [ | |
e501603b TO |
355 | 'name' => 'fee_level', |
356 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 357 | 'title' => ts('Fee level'), |
215b423e | 358 | 'description' => ts('Populate with the label (text) associated with a fee level for paid events with multiple levels. Note that |
fb607354 | 359 | we store the label value and not the key'), |
c3fc2621 | 360 | 'import' => TRUE, |
e501603b TO |
361 | 'where' => 'civicrm_participant.fee_level', |
362 | 'headerPattern' => '/^(f(ee\s)?level)$/i', | |
c3fc2621 | 363 | 'export' => TRUE, |
522a26c9 | 364 | 'table_name' => 'civicrm_participant', |
365 | 'entity' => 'Participant', | |
366 | 'bao' => 'CRM_Event_BAO_Participant', | |
6a7e5e5d | 367 | 'localizable' => 0, |
2a5c9b4d | 368 | 'serialize' => self::SERIALIZE_SEPARATOR_BOOKEND, |
a9d0587b | 369 | 'add' => '1.7', |
c3fc2621 CW |
370 | ], |
371 | 'participant_is_test' => [ | |
e501603b TO |
372 | 'name' => 'is_test', |
373 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 CW |
374 | 'title' => ts('Test'), |
375 | 'import' => TRUE, | |
e501603b | 376 | 'where' => 'civicrm_participant.is_test', |
c3fc2621 | 377 | 'export' => TRUE, |
45a83e42 | 378 | 'default' => '0', |
522a26c9 | 379 | 'table_name' => 'civicrm_participant', |
380 | 'entity' => 'Participant', | |
381 | 'bao' => 'CRM_Event_BAO_Participant', | |
6a7e5e5d | 382 | 'localizable' => 0, |
a9d0587b | 383 | 'add' => '1.7', |
c3fc2621 CW |
384 | ], |
385 | 'participant_is_pay_later' => [ | |
e501603b TO |
386 | 'name' => 'is_pay_later', |
387 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 CW |
388 | 'title' => ts('Is Pay Later'), |
389 | 'import' => TRUE, | |
e501603b TO |
390 | 'where' => 'civicrm_participant.is_pay_later', |
391 | 'headerPattern' => '/(is.)?(pay(.)?later)$/i', | |
c3fc2621 | 392 | 'export' => TRUE, |
45a83e42 | 393 | 'default' => '0', |
522a26c9 | 394 | 'table_name' => 'civicrm_participant', |
395 | 'entity' => 'Participant', | |
396 | 'bao' => 'CRM_Event_BAO_Participant', | |
6a7e5e5d | 397 | 'localizable' => 0, |
a9d0587b | 398 | 'add' => '2.1', |
c3fc2621 CW |
399 | ], |
400 | 'participant_fee_amount' => [ | |
e501603b TO |
401 | 'name' => 'fee_amount', |
402 | 'type' => CRM_Utils_Type::T_MONEY, | |
c3fc2621 | 403 | 'title' => ts('Fee Amount'), |
215b423e | 404 | 'description' => ts('actual processor fee if known - may be 0.'), |
c3fc2621 | 405 | 'precision' => [ |
e501603b | 406 | 20, |
fb607354 | 407 | 2, |
c3fc2621 CW |
408 | ], |
409 | 'import' => TRUE, | |
e501603b TO |
410 | 'where' => 'civicrm_participant.fee_amount', |
411 | 'headerPattern' => '/fee(.?am(ou)?nt)?/i', | |
412 | 'dataPattern' => '/^\d+(\.\d{2})?$/', | |
c3fc2621 | 413 | 'export' => TRUE, |
522a26c9 | 414 | 'table_name' => 'civicrm_participant', |
415 | 'entity' => 'Participant', | |
416 | 'bao' => 'CRM_Event_BAO_Participant', | |
6a7e5e5d | 417 | 'localizable' => 0, |
a9d0587b | 418 | 'add' => '2.1', |
c3fc2621 CW |
419 | ], |
420 | 'participant_registered_by_id' => [ | |
e501603b TO |
421 | 'name' => 'registered_by_id', |
422 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 423 | 'title' => ts('Registered By ID'), |
215b423e | 424 | 'description' => ts('FK to Participant ID'), |
c3fc2621 | 425 | 'import' => TRUE, |
e501603b | 426 | 'where' => 'civicrm_participant.registered_by_id', |
c3fc2621 | 427 | 'export' => TRUE, |
e501603b | 428 | 'default' => 'NULL', |
522a26c9 | 429 | 'table_name' => 'civicrm_participant', |
430 | 'entity' => 'Participant', | |
431 | 'bao' => 'CRM_Event_BAO_Participant', | |
6a7e5e5d | 432 | 'localizable' => 0, |
e501603b | 433 | 'FKClassName' => 'CRM_Event_DAO_Participant', |
a9d0587b | 434 | 'add' => '2.1', |
c3fc2621 CW |
435 | ], |
436 | 'participant_discount_id' => [ | |
e501603b TO |
437 | 'name' => 'discount_id', |
438 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 439 | 'title' => ts('Discount ID'), |
215b423e | 440 | 'description' => ts('FK to Discount ID'), |
a36434b9 | 441 | 'where' => 'civicrm_participant.discount_id', |
e501603b | 442 | 'default' => 'NULL', |
522a26c9 | 443 | 'table_name' => 'civicrm_participant', |
444 | 'entity' => 'Participant', | |
445 | 'bao' => 'CRM_Event_BAO_Participant', | |
6a7e5e5d | 446 | 'localizable' => 0, |
e501603b | 447 | 'FKClassName' => 'CRM_Core_DAO_Discount', |
a9d0587b | 448 | 'add' => '2.1', |
c3fc2621 CW |
449 | ], |
450 | 'participant_fee_currency' => [ | |
e501603b TO |
451 | 'name' => 'fee_currency', |
452 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 453 | 'title' => ts('Fee Currency'), |
215b423e | 454 | 'description' => ts('3 character string, value derived from config setting.'), |
e501603b TO |
455 | 'maxlength' => 3, |
456 | 'size' => CRM_Utils_Type::FOUR, | |
c3fc2621 | 457 | 'import' => TRUE, |
e501603b TO |
458 | 'where' => 'civicrm_participant.fee_currency', |
459 | 'headerPattern' => '/(fee)?.?cur(rency)?/i', | |
460 | 'dataPattern' => '/^[A-Z]{3}$/i', | |
c3fc2621 | 461 | 'export' => TRUE, |
e501603b | 462 | 'default' => 'NULL', |
522a26c9 | 463 | 'table_name' => 'civicrm_participant', |
464 | 'entity' => 'Participant', | |
465 | 'bao' => 'CRM_Event_BAO_Participant', | |
6a7e5e5d | 466 | 'localizable' => 0, |
c3fc2621 | 467 | 'html' => [ |
e501603b | 468 | 'type' => 'Select', |
c3fc2621 CW |
469 | ], |
470 | 'pseudoconstant' => [ | |
e501603b TO |
471 | 'table' => 'civicrm_currency', |
472 | 'keyColumn' => 'name', | |
473 | 'labelColumn' => 'full_name', | |
474 | 'nameColumn' => 'name', | |
a8fdb24e | 475 | 'abbrColumn' => 'symbol', |
e6ca0a57 | 476 | ], |
a9d0587b | 477 | 'add' => '3.0', |
c3fc2621 CW |
478 | ], |
479 | 'participant_campaign_id' => [ | |
e501603b TO |
480 | 'name' => 'campaign_id', |
481 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 482 | 'title' => ts('Campaign'), |
215b423e | 483 | 'description' => ts('The campaign for which this participant has been registered.'), |
c3fc2621 | 484 | 'import' => TRUE, |
e501603b | 485 | 'where' => 'civicrm_participant.campaign_id', |
c3fc2621 | 486 | 'export' => TRUE, |
522a26c9 | 487 | 'table_name' => 'civicrm_participant', |
488 | 'entity' => 'Participant', | |
489 | 'bao' => 'CRM_Event_BAO_Participant', | |
6a7e5e5d | 490 | 'localizable' => 0, |
e501603b | 491 | 'FKClassName' => 'CRM_Campaign_DAO_Campaign', |
c3fc2621 | 492 | 'pseudoconstant' => [ |
e501603b TO |
493 | 'table' => 'civicrm_campaign', |
494 | 'keyColumn' => 'id', | |
495 | 'labelColumn' => 'title', | |
e6ca0a57 | 496 | ], |
a9d0587b | 497 | 'add' => '3.4', |
c3fc2621 CW |
498 | ], |
499 | 'discount_amount' => [ | |
e501603b TO |
500 | 'name' => 'discount_amount', |
501 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 502 | 'title' => ts('Discount Amount'), |
215b423e | 503 | 'description' => ts('Discount Amount'), |
a36434b9 | 504 | 'where' => 'civicrm_participant.discount_amount', |
522a26c9 | 505 | 'table_name' => 'civicrm_participant', |
506 | 'entity' => 'Participant', | |
507 | 'bao' => 'CRM_Event_BAO_Participant', | |
6a7e5e5d | 508 | 'localizable' => 0, |
a9d0587b | 509 | 'add' => '4.1', |
c3fc2621 CW |
510 | ], |
511 | 'cart_id' => [ | |
e501603b TO |
512 | 'name' => 'cart_id', |
513 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 514 | 'title' => ts('Event Cart ID'), |
215b423e | 515 | 'description' => ts('FK to civicrm_event_carts'), |
a36434b9 | 516 | 'where' => 'civicrm_participant.cart_id', |
522a26c9 | 517 | 'table_name' => 'civicrm_participant', |
518 | 'entity' => 'Participant', | |
519 | 'bao' => 'CRM_Event_BAO_Participant', | |
6a7e5e5d | 520 | 'localizable' => 0, |
e501603b | 521 | 'FKClassName' => 'CRM_Event_Cart_DAO_Cart', |
a9d0587b | 522 | 'add' => '4.1', |
c3fc2621 CW |
523 | ], |
524 | 'must_wait' => [ | |
e501603b TO |
525 | 'name' => 'must_wait', |
526 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 527 | 'title' => ts('Must Wait on List'), |
215b423e | 528 | 'description' => ts('On Waiting List'), |
a36434b9 | 529 | 'where' => 'civicrm_participant.must_wait', |
522a26c9 | 530 | 'table_name' => 'civicrm_participant', |
531 | 'entity' => 'Participant', | |
532 | 'bao' => 'CRM_Event_BAO_Participant', | |
6a7e5e5d | 533 | 'localizable' => 0, |
a9d0587b | 534 | 'add' => '4.1', |
c3fc2621 CW |
535 | ], |
536 | 'transferred_to_contact_id' => [ | |
e501603b TO |
537 | 'name' => 'transferred_to_contact_id', |
538 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 539 | 'title' => ts('Transferred to Contact ID'), |
215b423e | 540 | 'description' => ts('FK to Contact ID'), |
c3fc2621 | 541 | 'import' => TRUE, |
e501603b TO |
542 | 'where' => 'civicrm_participant.transferred_to_contact_id', |
543 | 'headerPattern' => '/transfer(.?id)?/i', | |
c3fc2621 | 544 | 'export' => TRUE, |
e501603b | 545 | 'default' => 'NULL', |
522a26c9 | 546 | 'table_name' => 'civicrm_participant', |
547 | 'entity' => 'Participant', | |
548 | 'bao' => 'CRM_Event_BAO_Participant', | |
6a7e5e5d | 549 | 'localizable' => 0, |
e501603b | 550 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
a9d0587b | 551 | 'add' => '4.7', |
c3fc2621 CW |
552 | ], |
553 | ]; | |
346aaaba | 554 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 555 | } |
346aaaba | 556 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 557 | } |
c3fc2621 | 558 | |
e501603b | 559 | /** |
bd8e0b14 | 560 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
561 | * |
562 | * @return array | |
bd8e0b14 | 563 | * Array(string $name => string $uniqueName). |
e501603b | 564 | */ |
c3fc2621 | 565 | public static function &fieldKeys() { |
bd8e0b14 TO |
566 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
567 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 568 | } |
bd8e0b14 | 569 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 570 | } |
c3fc2621 | 571 | |
e501603b TO |
572 | /** |
573 | * Returns the names of this table | |
574 | * | |
575 | * @return string | |
576 | */ | |
c3fc2621 | 577 | public static function getTableName() { |
e501603b TO |
578 | return self::$_tableName; |
579 | } | |
c3fc2621 | 580 | |
e501603b TO |
581 | /** |
582 | * Returns if this table needs to be logged | |
583 | * | |
c3fc2621 | 584 | * @return bool |
e501603b | 585 | */ |
c3fc2621 | 586 | public function getLog() { |
e501603b TO |
587 | return self::$_log; |
588 | } | |
c3fc2621 | 589 | |
e501603b TO |
590 | /** |
591 | * Returns the list of fields that can be imported | |
592 | * | |
593 | * @param bool $prefix | |
594 | * | |
595 | * @return array | |
596 | */ | |
c3fc2621 CW |
597 | public static function &import($prefix = FALSE) { |
598 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'participant', $prefix, []); | |
60808919 | 599 | return $r; |
e501603b | 600 | } |
c3fc2621 | 601 | |
e501603b TO |
602 | /** |
603 | * Returns the list of fields that can be exported | |
604 | * | |
605 | * @param bool $prefix | |
606 | * | |
607 | * @return array | |
608 | */ | |
c3fc2621 CW |
609 | public static function &export($prefix = FALSE) { |
610 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'participant', $prefix, []); | |
60808919 | 611 | return $r; |
e501603b | 612 | } |
c3fc2621 | 613 | |
e7a6b91a AS |
614 | /** |
615 | * Returns the list of indices | |
c3fc2621 CW |
616 | * |
617 | * @param bool $localize | |
618 | * | |
619 | * @return array | |
e7a6b91a AS |
620 | */ |
621 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
622 | $indices = [ |
623 | 'index_status_id' => [ | |
e7a6b91a | 624 | 'name' => 'index_status_id', |
c3fc2621 | 625 | 'field' => [ |
e7a6b91a | 626 | 0 => 'status_id', |
c3fc2621 CW |
627 | ], |
628 | 'localizable' => FALSE, | |
e7a6b91a | 629 | 'sig' => 'civicrm_participant::0::status_id', |
c3fc2621 CW |
630 | ], |
631 | 'index_role_id' => [ | |
e7a6b91a | 632 | 'name' => 'index_role_id', |
c3fc2621 | 633 | 'field' => [ |
e7a6b91a | 634 | 0 => 'role_id', |
c3fc2621 CW |
635 | ], |
636 | 'localizable' => FALSE, | |
e7a6b91a | 637 | 'sig' => 'civicrm_participant::0::role_id', |
c3fc2621 CW |
638 | ], |
639 | ]; | |
e7a6b91a AS |
640 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
641 | } | |
c3fc2621 | 642 | |
e501603b | 643 | } |