3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Event/Participant.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:87c3d1afa18e39e10ba019d773eb6ce8)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Event_DAO_Participant constructor.
40 class CRM_Event_DAO_Participant
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_participant';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
72 * Participant status ID. FK to civicrm_participant_status_type. Default of 1 should map to status = Registered.
78 * Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.
84 * When did contact register for event?
88 public $register_date;
90 * Source of this event registration.
96 * Populate with the label (text) associated with a fee level for paid events with multiple levels. Note that
97 we store the label value and not the key
111 public $is_pay_later;
113 * actual processor fee if known - may be 0.
119 * FK to Participant ID
123 public $registered_by_id;
131 * 3 character string, value derived from config setting.
135 public $fee_currency;
137 * The campaign for which this participant has been registered.
147 public $discount_amount;
149 * FK to civicrm_event_carts
165 public $transferred_to_contact_id;
169 function __construct() {
170 $this->__table
= 'civicrm_participant';
171 parent
::__construct();
174 * Returns foreign keys and entity references.
177 * [CRM_Core_Reference_Interface]
179 static function getReferenceColumns() {
180 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
181 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
182 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contact_id', 'civicrm_contact', 'id');
183 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'event_id', 'civicrm_event', 'id');
184 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'status_id', 'civicrm_participant_status_type', 'id');
185 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'registered_by_id', 'civicrm_participant', 'id');
186 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'discount_id', 'civicrm_discount', 'id');
187 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'campaign_id', 'civicrm_campaign', 'id');
188 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'cart_id', 'civicrm_event_carts', 'id');
189 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'transferred_to_contact_id', 'civicrm_contact', 'id');
190 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
192 return Civi
::$statics[__CLASS__
]['links'];
195 * Returns all the column names of this table
199 static function &fields() {
200 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
201 Civi
::$statics[__CLASS__
]['fields'] = array(
202 'participant_id' => array(
204 'type' => CRM_Utils_Type
::T_INT
,
205 'title' => ts('Participant ID') ,
206 'description' => 'Participant Id',
209 'where' => 'civicrm_participant.id',
210 'headerPattern' => '/(^(participant(.)?)?id$)/i',
213 'table_name' => 'civicrm_participant',
214 'entity' => 'Participant',
215 'bao' => 'CRM_Event_BAO_Participant',
217 'participant_contact_id' => array(
218 'name' => 'contact_id',
219 'type' => CRM_Utils_Type
::T_INT
,
220 'title' => ts('Contact ID') ,
221 'description' => 'FK to Contact ID',
224 'where' => 'civicrm_participant.contact_id',
225 'headerPattern' => '/contact(.?id)?/i',
228 'table_name' => 'civicrm_participant',
229 'entity' => 'Participant',
230 'bao' => 'CRM_Event_BAO_Participant',
231 'FKClassName' => 'CRM_Contact_DAO_Contact',
234 'name' => 'event_id',
235 'type' => CRM_Utils_Type
::T_INT
,
236 'title' => ts('Event') ,
237 'description' => 'FK to Event ID',
240 'where' => 'civicrm_participant.event_id',
241 'headerPattern' => '/event id$/i',
244 'table_name' => 'civicrm_participant',
245 'entity' => 'Participant',
246 'bao' => 'CRM_Event_BAO_Participant',
247 'FKClassName' => 'CRM_Event_DAO_Event',
249 'participant_status_id' => array(
250 'name' => 'status_id',
251 'type' => CRM_Utils_Type
::T_INT
,
252 'title' => ts('Participant Status') ,
253 'description' => 'Participant status ID. FK to civicrm_participant_status_type. Default of 1 should map to status = Registered.',
256 'where' => 'civicrm_participant.status_id',
257 'headerPattern' => '/(participant.)?(status)$/i',
261 'table_name' => 'civicrm_participant',
262 'entity' => 'Participant',
263 'bao' => 'CRM_Event_BAO_Participant',
264 'FKClassName' => 'CRM_Event_DAO_ParticipantStatusType',
268 'pseudoconstant' => array(
269 'table' => 'civicrm_participant_status_type',
271 'labelColumn' => 'label',
274 'participant_role_id' => array(
276 'type' => CRM_Utils_Type
::T_STRING
,
277 'title' => ts('Participant Role') ,
278 'description' => 'Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.',
280 'size' => CRM_Utils_Type
::HUGE
,
282 'where' => 'civicrm_participant.role_id',
283 'headerPattern' => '/(participant.)?(role)$/i',
287 'table_name' => 'civicrm_participant',
288 'entity' => 'Participant',
289 'bao' => 'CRM_Event_BAO_Participant',
293 'pseudoconstant' => array(
294 'optionGroupName' => 'participant_role',
295 'optionEditPath' => 'civicrm/admin/options/participant_role',
298 'participant_register_date' => array(
299 'name' => 'register_date',
300 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
301 'title' => ts('Register date') ,
302 'description' => 'When did contact register for event?',
304 'where' => 'civicrm_participant.register_date',
305 'headerPattern' => '/^(r(egister\s)?date)$/i',
308 'table_name' => 'civicrm_participant',
309 'entity' => 'Participant',
310 'bao' => 'CRM_Event_BAO_Participant',
312 'type' => 'Select Date',
313 'formatType' => 'activityDateTime',
316 'participant_source' => array(
318 'type' => CRM_Utils_Type
::T_STRING
,
319 'title' => ts('Participant Source') ,
320 'description' => 'Source of this event registration.',
322 'size' => CRM_Utils_Type
::HUGE
,
324 'where' => 'civicrm_participant.source',
325 'headerPattern' => '/(participant.)?(source)$/i',
328 'table_name' => 'civicrm_participant',
329 'entity' => 'Participant',
330 'bao' => 'CRM_Event_BAO_Participant',
332 'participant_fee_level' => array(
333 'name' => 'fee_level',
334 'type' => CRM_Utils_Type
::T_TEXT
,
335 'title' => ts('Fee level') ,
336 'description' => 'Populate with the label (text) associated with a fee level for paid events with multiple levels. Note that
337 we store the label value and not the key
340 'where' => 'civicrm_participant.fee_level',
341 'headerPattern' => '/^(f(ee\s)?level)$/i',
344 'table_name' => 'civicrm_participant',
345 'entity' => 'Participant',
346 'bao' => 'CRM_Event_BAO_Participant',
348 'participant_is_test' => array(
350 'type' => CRM_Utils_Type
::T_BOOLEAN
,
351 'title' => ts('Test') ,
353 'where' => 'civicrm_participant.is_test',
354 'headerPattern' => '',
357 'table_name' => 'civicrm_participant',
358 'entity' => 'Participant',
359 'bao' => 'CRM_Event_BAO_Participant',
361 'participant_is_pay_later' => array(
362 'name' => 'is_pay_later',
363 'type' => CRM_Utils_Type
::T_BOOLEAN
,
364 'title' => ts('Is Pay Later') ,
366 'where' => 'civicrm_participant.is_pay_later',
367 'headerPattern' => '/(is.)?(pay(.)?later)$/i',
370 'table_name' => 'civicrm_participant',
371 'entity' => 'Participant',
372 'bao' => 'CRM_Event_BAO_Participant',
374 'participant_fee_amount' => array(
375 'name' => 'fee_amount',
376 'type' => CRM_Utils_Type
::T_MONEY
,
377 'title' => ts('Fee Amount') ,
378 'description' => 'actual processor fee if known - may be 0.',
379 'precision' => array(
384 'where' => 'civicrm_participant.fee_amount',
385 'headerPattern' => '/fee(.?am(ou)?nt)?/i',
386 'dataPattern' => '/^\d+(\.\d{2})?$/',
388 'table_name' => 'civicrm_participant',
389 'entity' => 'Participant',
390 'bao' => 'CRM_Event_BAO_Participant',
392 'participant_registered_by_id' => array(
393 'name' => 'registered_by_id',
394 'type' => CRM_Utils_Type
::T_INT
,
395 'title' => ts('Registered By ID') ,
396 'description' => 'FK to Participant ID',
398 'where' => 'civicrm_participant.registered_by_id',
399 'headerPattern' => '',
403 'table_name' => 'civicrm_participant',
404 'entity' => 'Participant',
405 'bao' => 'CRM_Event_BAO_Participant',
406 'FKClassName' => 'CRM_Event_DAO_Participant',
408 'participant_discount_id' => array(
409 'name' => 'discount_id',
410 'type' => CRM_Utils_Type
::T_INT
,
411 'title' => ts('Discount ID') ,
412 'description' => 'FK to Discount ID',
414 'table_name' => 'civicrm_participant',
415 'entity' => 'Participant',
416 'bao' => 'CRM_Event_BAO_Participant',
417 'FKClassName' => 'CRM_Core_DAO_Discount',
419 'participant_fee_currency' => array(
420 'name' => 'fee_currency',
421 'type' => CRM_Utils_Type
::T_STRING
,
422 'title' => ts('Fee Currency') ,
423 'description' => '3 character string, value derived from config setting.',
425 'size' => CRM_Utils_Type
::FOUR
,
427 'where' => 'civicrm_participant.fee_currency',
428 'headerPattern' => '/(fee)?.?cur(rency)?/i',
429 'dataPattern' => '/^[A-Z]{3}$/i',
432 'table_name' => 'civicrm_participant',
433 'entity' => 'Participant',
434 'bao' => 'CRM_Event_BAO_Participant',
438 'pseudoconstant' => array(
439 'table' => 'civicrm_currency',
440 'keyColumn' => 'name',
441 'labelColumn' => 'full_name',
442 'nameColumn' => 'name',
445 'participant_campaign_id' => array(
446 'name' => 'campaign_id',
447 'type' => CRM_Utils_Type
::T_INT
,
448 'title' => ts('Campaign') ,
449 'description' => 'The campaign for which this participant has been registered.',
451 'where' => 'civicrm_participant.campaign_id',
452 'headerPattern' => '',
455 'table_name' => 'civicrm_participant',
456 'entity' => 'Participant',
457 'bao' => 'CRM_Event_BAO_Participant',
458 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
459 'pseudoconstant' => array(
460 'table' => 'civicrm_campaign',
462 'labelColumn' => 'title',
465 'discount_amount' => array(
466 'name' => 'discount_amount',
467 'type' => CRM_Utils_Type
::T_INT
,
468 'title' => ts('Discount Amount') ,
469 'description' => 'Discount Amount',
470 'table_name' => 'civicrm_participant',
471 'entity' => 'Participant',
472 'bao' => 'CRM_Event_BAO_Participant',
476 'type' => CRM_Utils_Type
::T_INT
,
477 'title' => ts('Event Cart ID') ,
478 'description' => 'FK to civicrm_event_carts',
479 'table_name' => 'civicrm_participant',
480 'entity' => 'Participant',
481 'bao' => 'CRM_Event_BAO_Participant',
482 'FKClassName' => 'CRM_Event_Cart_DAO_Cart',
484 'must_wait' => array(
485 'name' => 'must_wait',
486 'type' => CRM_Utils_Type
::T_INT
,
487 'title' => ts('Must Wait on List') ,
488 'description' => 'On Waiting List',
489 'table_name' => 'civicrm_participant',
490 'entity' => 'Participant',
491 'bao' => 'CRM_Event_BAO_Participant',
493 'transferred_to_contact_id' => array(
494 'name' => 'transferred_to_contact_id',
495 'type' => CRM_Utils_Type
::T_INT
,
496 'title' => ts('Transferred to Contact ID') ,
497 'description' => 'FK to Contact ID',
499 'where' => 'civicrm_participant.transferred_to_contact_id',
500 'headerPattern' => '/transfer(.?id)?/i',
504 'table_name' => 'civicrm_participant',
505 'entity' => 'Participant',
506 'bao' => 'CRM_Event_BAO_Participant',
507 'FKClassName' => 'CRM_Contact_DAO_Contact',
510 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
512 return Civi
::$statics[__CLASS__
]['fields'];
515 * Return a mapping from field-name to the corresponding key (as used in fields()).
518 * Array(string $name => string $uniqueName).
520 static function &fieldKeys() {
521 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
522 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
524 return Civi
::$statics[__CLASS__
]['fieldKeys'];
527 * Returns the names of this table
531 static function getTableName() {
532 return self
::$_tableName;
535 * Returns if this table needs to be logged
543 * Returns the list of fields that can be imported
545 * @param bool $prefix
549 static function &import($prefix = false) {
550 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'participant', $prefix, array());
554 * Returns the list of fields that can be exported
556 * @param bool $prefix
560 static function &export($prefix = false) {
561 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'participant', $prefix, array());