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:89138cc7e79eac37b1b499084956428f)
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',
218 'participant_contact_id' => array(
219 'name' => 'contact_id',
220 'type' => CRM_Utils_Type
::T_INT
,
221 'title' => ts('Contact ID') ,
222 'description' => 'FK to Contact ID',
225 'where' => 'civicrm_participant.contact_id',
226 'headerPattern' => '/contact(.?id)?/i',
229 'table_name' => 'civicrm_participant',
230 'entity' => 'Participant',
231 'bao' => 'CRM_Event_BAO_Participant',
233 'FKClassName' => 'CRM_Contact_DAO_Contact',
236 'name' => 'event_id',
237 'type' => CRM_Utils_Type
::T_INT
,
238 'title' => ts('Event') ,
239 'description' => 'FK to Event ID',
242 'where' => 'civicrm_participant.event_id',
243 'headerPattern' => '/event id$/i',
246 'table_name' => 'civicrm_participant',
247 'entity' => 'Participant',
248 'bao' => 'CRM_Event_BAO_Participant',
250 'FKClassName' => 'CRM_Event_DAO_Event',
252 'participant_status_id' => array(
253 'name' => 'status_id',
254 'type' => CRM_Utils_Type
::T_INT
,
255 'title' => ts('Participant Status') ,
256 'description' => 'Participant status ID. FK to civicrm_participant_status_type. Default of 1 should map to status = Registered.',
259 'where' => 'civicrm_participant.status_id',
260 'headerPattern' => '/(participant.)?(status)$/i',
264 'table_name' => 'civicrm_participant',
265 'entity' => 'Participant',
266 'bao' => 'CRM_Event_BAO_Participant',
268 'FKClassName' => 'CRM_Event_DAO_ParticipantStatusType',
272 'pseudoconstant' => array(
273 'table' => 'civicrm_participant_status_type',
275 'labelColumn' => 'label',
278 'participant_role_id' => array(
280 'type' => CRM_Utils_Type
::T_STRING
,
281 'title' => ts('Participant Role') ,
282 'description' => 'Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.',
284 'size' => CRM_Utils_Type
::HUGE
,
286 'where' => 'civicrm_participant.role_id',
287 'headerPattern' => '/(participant.)?(role)$/i',
291 'table_name' => 'civicrm_participant',
292 'entity' => 'Participant',
293 'bao' => 'CRM_Event_BAO_Participant',
298 'pseudoconstant' => array(
299 'optionGroupName' => 'participant_role',
300 'optionEditPath' => 'civicrm/admin/options/participant_role',
303 'participant_register_date' => array(
304 'name' => 'register_date',
305 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
306 'title' => ts('Register date') ,
307 'description' => 'When did contact register for event?',
309 'where' => 'civicrm_participant.register_date',
310 'headerPattern' => '/^(r(egister\s)?date)$/i',
313 'table_name' => 'civicrm_participant',
314 'entity' => 'Participant',
315 'bao' => 'CRM_Event_BAO_Participant',
318 'type' => 'Select Date',
319 'formatType' => 'activityDateTime',
322 'participant_source' => array(
324 'type' => CRM_Utils_Type
::T_STRING
,
325 'title' => ts('Participant Source') ,
326 'description' => 'Source of this event registration.',
328 'size' => CRM_Utils_Type
::HUGE
,
330 'where' => 'civicrm_participant.source',
331 'headerPattern' => '/(participant.)?(source)$/i',
334 'table_name' => 'civicrm_participant',
335 'entity' => 'Participant',
336 'bao' => 'CRM_Event_BAO_Participant',
339 'participant_fee_level' => array(
340 'name' => 'fee_level',
341 'type' => CRM_Utils_Type
::T_TEXT
,
342 'title' => ts('Fee level') ,
343 'description' => 'Populate with the label (text) associated with a fee level for paid events with multiple levels. Note that
344 we store the label value and not the key
347 'where' => 'civicrm_participant.fee_level',
348 'headerPattern' => '/^(f(ee\s)?level)$/i',
351 'table_name' => 'civicrm_participant',
352 'entity' => 'Participant',
353 'bao' => 'CRM_Event_BAO_Participant',
356 'participant_is_test' => array(
358 'type' => CRM_Utils_Type
::T_BOOLEAN
,
359 'title' => ts('Test') ,
361 'where' => 'civicrm_participant.is_test',
362 'headerPattern' => '',
365 'table_name' => 'civicrm_participant',
366 'entity' => 'Participant',
367 'bao' => 'CRM_Event_BAO_Participant',
370 'participant_is_pay_later' => array(
371 'name' => 'is_pay_later',
372 'type' => CRM_Utils_Type
::T_BOOLEAN
,
373 'title' => ts('Is Pay Later') ,
375 'where' => 'civicrm_participant.is_pay_later',
376 'headerPattern' => '/(is.)?(pay(.)?later)$/i',
379 'table_name' => 'civicrm_participant',
380 'entity' => 'Participant',
381 'bao' => 'CRM_Event_BAO_Participant',
384 'participant_fee_amount' => array(
385 'name' => 'fee_amount',
386 'type' => CRM_Utils_Type
::T_MONEY
,
387 'title' => ts('Fee Amount') ,
388 'description' => 'actual processor fee if known - may be 0.',
389 'precision' => array(
394 'where' => 'civicrm_participant.fee_amount',
395 'headerPattern' => '/fee(.?am(ou)?nt)?/i',
396 'dataPattern' => '/^\d+(\.\d{2})?$/',
398 'table_name' => 'civicrm_participant',
399 'entity' => 'Participant',
400 'bao' => 'CRM_Event_BAO_Participant',
403 'participant_registered_by_id' => array(
404 'name' => 'registered_by_id',
405 'type' => CRM_Utils_Type
::T_INT
,
406 'title' => ts('Registered By ID') ,
407 'description' => 'FK to Participant ID',
409 'where' => 'civicrm_participant.registered_by_id',
410 'headerPattern' => '',
414 'table_name' => 'civicrm_participant',
415 'entity' => 'Participant',
416 'bao' => 'CRM_Event_BAO_Participant',
418 'FKClassName' => 'CRM_Event_DAO_Participant',
420 'participant_discount_id' => array(
421 'name' => 'discount_id',
422 'type' => CRM_Utils_Type
::T_INT
,
423 'title' => ts('Discount ID') ,
424 'description' => 'FK to Discount ID',
426 'table_name' => 'civicrm_participant',
427 'entity' => 'Participant',
428 'bao' => 'CRM_Event_BAO_Participant',
430 'FKClassName' => 'CRM_Core_DAO_Discount',
432 'participant_fee_currency' => array(
433 'name' => 'fee_currency',
434 'type' => CRM_Utils_Type
::T_STRING
,
435 'title' => ts('Fee Currency') ,
436 'description' => '3 character string, value derived from config setting.',
438 'size' => CRM_Utils_Type
::FOUR
,
440 'where' => 'civicrm_participant.fee_currency',
441 'headerPattern' => '/(fee)?.?cur(rency)?/i',
442 'dataPattern' => '/^[A-Z]{3}$/i',
445 'table_name' => 'civicrm_participant',
446 'entity' => 'Participant',
447 'bao' => 'CRM_Event_BAO_Participant',
452 'pseudoconstant' => array(
453 'table' => 'civicrm_currency',
454 'keyColumn' => 'name',
455 'labelColumn' => 'full_name',
456 'nameColumn' => 'name',
459 'participant_campaign_id' => array(
460 'name' => 'campaign_id',
461 'type' => CRM_Utils_Type
::T_INT
,
462 'title' => ts('Campaign') ,
463 'description' => 'The campaign for which this participant has been registered.',
465 'where' => 'civicrm_participant.campaign_id',
466 'headerPattern' => '',
469 'table_name' => 'civicrm_participant',
470 'entity' => 'Participant',
471 'bao' => 'CRM_Event_BAO_Participant',
473 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
474 'pseudoconstant' => array(
475 'table' => 'civicrm_campaign',
477 'labelColumn' => 'title',
480 'discount_amount' => array(
481 'name' => 'discount_amount',
482 'type' => CRM_Utils_Type
::T_INT
,
483 'title' => ts('Discount Amount') ,
484 'description' => 'Discount Amount',
485 'table_name' => 'civicrm_participant',
486 'entity' => 'Participant',
487 'bao' => 'CRM_Event_BAO_Participant',
492 'type' => CRM_Utils_Type
::T_INT
,
493 'title' => ts('Event Cart ID') ,
494 'description' => 'FK to civicrm_event_carts',
495 'table_name' => 'civicrm_participant',
496 'entity' => 'Participant',
497 'bao' => 'CRM_Event_BAO_Participant',
499 'FKClassName' => 'CRM_Event_Cart_DAO_Cart',
501 'must_wait' => array(
502 'name' => 'must_wait',
503 'type' => CRM_Utils_Type
::T_INT
,
504 'title' => ts('Must Wait on List') ,
505 'description' => 'On Waiting List',
506 'table_name' => 'civicrm_participant',
507 'entity' => 'Participant',
508 'bao' => 'CRM_Event_BAO_Participant',
511 'transferred_to_contact_id' => array(
512 'name' => 'transferred_to_contact_id',
513 'type' => CRM_Utils_Type
::T_INT
,
514 'title' => ts('Transferred to Contact ID') ,
515 'description' => 'FK to Contact ID',
517 'where' => 'civicrm_participant.transferred_to_contact_id',
518 'headerPattern' => '/transfer(.?id)?/i',
522 'table_name' => 'civicrm_participant',
523 'entity' => 'Participant',
524 'bao' => 'CRM_Event_BAO_Participant',
526 'FKClassName' => 'CRM_Contact_DAO_Contact',
529 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
531 return Civi
::$statics[__CLASS__
]['fields'];
534 * Return a mapping from field-name to the corresponding key (as used in fields()).
537 * Array(string $name => string $uniqueName).
539 static function &fieldKeys() {
540 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
541 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
543 return Civi
::$statics[__CLASS__
]['fieldKeys'];
546 * Returns the names of this table
550 static function getTableName() {
551 return self
::$_tableName;
554 * Returns if this table needs to be logged
562 * Returns the list of fields that can be imported
564 * @param bool $prefix
568 static function &import($prefix = false) {
569 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'participant', $prefix, array());
573 * Returns the list of fields that can be exported
575 * @param bool $prefix
579 static function &export($prefix = false) {
580 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'participant', $prefix, array());
584 * Returns the list of indices
586 public static function indices($localize = TRUE) {
588 'index_status_id' => array(
589 'name' => 'index_status_id',
593 'localizable' => false,
594 'sig' => 'civicrm_participant::0::status_id',
596 'index_role_id' => array(
597 'name' => 'index_role_id',
601 'localizable' => false,
602 'sig' => 'civicrm_participant::0::role_id',
605 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;