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