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