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