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