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