3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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-2015
31 * Generated from xml/schema/CRM/Event/Participant.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Event_DAO_Participant
extends CRM_Core_DAO
{
38 * static instance to hold the table name
42 static $_tableName = 'civicrm_participant';
44 * static instance to hold the field values
48 static $_fields = null;
50 * static instance to hold the keys used in $_fields for each field.
54 static $_fieldKeys = null;
56 * static instance to hold the FK relationships
60 static $_links = null;
62 * static instance to hold the values that can
67 static $_import = null;
69 * static instance to hold the values that can
74 static $_export = null;
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
101 * Participant status ID. FK to civicrm_participant_status_type. Default of 1 should map to status =
108 * Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.
114 * When did contact register for event?
118 public $register_date;
120 * Source of this event registration.
126 * Populate with the label (text) associated with a fee level for paid events with multiple levels. Note that
127 we store the label value and not the key
141 public $is_pay_later;
143 * actual processor fee if known - may be 0.
149 * FK to Participant ID
153 public $registered_by_id;
161 * 3 character string, value derived from config setting.
165 public $fee_currency;
167 * The campaign for which this participant has been registered.
177 public $discount_amount;
179 * FK to civicrm_event_carts
193 * @return civicrm_participant
195 function __construct() {
196 $this->__table
= 'civicrm_participant';
197 parent
::__construct();
200 * Returns foreign keys and entity references
203 * [CRM_Core_Reference_Interface]
205 static function getReferenceColumns() {
206 if (!self
::$_links) {
207 self
::$_links = static ::createReferenceColumns(__CLASS__
);
208 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contact_id', 'civicrm_contact', 'id');
209 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'event_id', 'civicrm_event', 'id');
210 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'status_id', 'civicrm_participant_status_type', 'id');
211 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'registered_by_id', 'civicrm_participant', 'id');
212 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'discount_id', 'civicrm_discount', 'id');
213 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'campaign_id', 'civicrm_campaign', 'id');
214 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'cart_id', 'civicrm_event_carts', 'id');
216 return self
::$_links;
219 * Returns all the column names of this table
223 static function &fields() {
224 if (!(self
::$_fields)) {
225 self
::$_fields = array(
226 'participant_id' => array(
228 'type' => CRM_Utils_Type
::T_INT
,
229 'title' => ts('Participant ID') ,
230 'description' => 'Participant Id',
233 'where' => 'civicrm_participant.id',
234 'headerPattern' => '/(^(participant(.)?)?id$)/i',
238 'participant_contact_id' => array(
239 'name' => 'contact_id',
240 'type' => CRM_Utils_Type
::T_INT
,
241 'title' => ts('Contact ID') ,
242 'description' => 'FK to Contact ID',
245 'where' => 'civicrm_participant.contact_id',
246 'headerPattern' => '/contact(.?id)?/i',
249 'FKClassName' => 'CRM_Contact_DAO_Contact',
252 'name' => 'event_id',
253 'type' => CRM_Utils_Type
::T_INT
,
254 'title' => ts('Event') ,
255 'description' => 'FK to Event ID',
258 'where' => 'civicrm_participant.event_id',
259 'headerPattern' => '/event id$/i',
262 'FKClassName' => 'CRM_Event_DAO_Event',
264 'participant_status_id' => array(
265 'name' => 'status_id',
266 'type' => CRM_Utils_Type
::T_INT
,
267 'title' => ts('Participant Status ID') ,
268 'description' => 'Participant status ID. FK to civicrm_participant_status_type. Default of 1 should map to status =
273 'where' => 'civicrm_participant.status_id',
274 'headerPattern' => '/(participant.)?(status)$/i',
278 'FKClassName' => 'CRM_Event_DAO_ParticipantStatusType',
282 'pseudoconstant' => array(
283 'table' => 'civicrm_participant_status_type',
285 'labelColumn' => 'label',
288 'participant_role_id' => array(
290 'type' => CRM_Utils_Type
::T_STRING
,
291 'title' => ts('Participant Role ID') ,
292 'description' => 'Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.',
294 'size' => CRM_Utils_Type
::HUGE
,
296 'where' => 'civicrm_participant.role_id',
297 'headerPattern' => '/(participant.)?(role)$/i',
304 'pseudoconstant' => array(
305 'optionGroupName' => 'participant_role',
306 'optionEditPath' => 'civicrm/admin/options/participant_role',
309 'participant_register_date' => array(
310 'name' => 'register_date',
311 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
312 'title' => ts('Register date') ,
313 'description' => 'When did contact register for event?',
315 'where' => 'civicrm_participant.register_date',
316 'headerPattern' => '/^(r(egister\s)?date)$/i',
320 'participant_source' => array(
322 'type' => CRM_Utils_Type
::T_STRING
,
323 'title' => ts('Participant Source') ,
324 'description' => 'Source of this event registration.',
326 'size' => CRM_Utils_Type
::HUGE
,
328 'where' => 'civicrm_participant.source',
329 'headerPattern' => '/(participant.)?(source)$/i',
333 'participant_fee_level' => array(
334 'name' => 'fee_level',
335 'type' => CRM_Utils_Type
::T_TEXT
,
336 'title' => ts('Fee level') ,
337 'description' => 'Populate with the label (text) associated with a fee level for paid events with multiple levels. Note that
338 we store the label value and not the key
341 'where' => 'civicrm_participant.fee_level',
342 'headerPattern' => '/^(f(ee\s)?level)$/i',
346 'participant_is_test' => array(
348 'type' => CRM_Utils_Type
::T_BOOLEAN
,
349 'title' => ts('Test') ,
351 'where' => 'civicrm_participant.is_test',
352 'headerPattern' => '',
356 'participant_is_pay_later' => array(
357 'name' => 'is_pay_later',
358 'type' => CRM_Utils_Type
::T_BOOLEAN
,
359 'title' => ts('Is Pay Later') ,
361 'where' => 'civicrm_participant.is_pay_later',
362 'headerPattern' => '/(is.)?(pay(.)?later)$/i',
366 'participant_fee_amount' => array(
367 'name' => 'fee_amount',
368 'type' => CRM_Utils_Type
::T_MONEY
,
369 'title' => ts('Fee Amount') ,
370 'description' => 'actual processor fee if known - may be 0.',
371 'precision' => array(
376 'where' => 'civicrm_participant.fee_amount',
377 'headerPattern' => '/fee(.?am(ou)?nt)?/i',
378 'dataPattern' => '/^\d+(\.\d{2})?$/',
381 'participant_registered_by_id' => array(
382 'name' => 'registered_by_id',
383 'type' => CRM_Utils_Type
::T_INT
,
384 'title' => ts('Registered By ID') ,
385 'description' => 'FK to Participant ID',
387 'where' => 'civicrm_participant.registered_by_id',
388 'headerPattern' => '',
392 'FKClassName' => 'CRM_Event_DAO_Participant',
394 'participant_discount_id' => array(
395 'name' => 'discount_id',
396 'type' => CRM_Utils_Type
::T_INT
,
397 'title' => ts('Discount ID') ,
398 'description' => 'FK to Discount ID',
400 'FKClassName' => 'CRM_Core_DAO_Discount',
402 'participant_fee_currency' => array(
403 'name' => 'fee_currency',
404 'type' => CRM_Utils_Type
::T_STRING
,
405 'title' => ts('Fee Currency') ,
406 'description' => '3 character string, value derived from config setting.',
408 'size' => CRM_Utils_Type
::FOUR
,
410 'where' => 'civicrm_participant.fee_currency',
411 'headerPattern' => '/(fee)?.?cur(rency)?/i',
412 'dataPattern' => '/^[A-Z]{3}$/i',
418 'pseudoconstant' => array(
419 'table' => 'civicrm_currency',
420 'keyColumn' => 'name',
421 'labelColumn' => 'full_name',
422 'nameColumn' => 'numeric_code',
425 'participant_campaign_id' => array(
426 'name' => 'campaign_id',
427 'type' => CRM_Utils_Type
::T_INT
,
428 'title' => ts('Campaign') ,
429 'description' => 'The campaign for which this participant has been registered.',
431 'where' => 'civicrm_participant.campaign_id',
432 'headerPattern' => '',
435 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
436 'pseudoconstant' => array(
437 'table' => 'civicrm_campaign',
439 'labelColumn' => 'title',
442 'discount_amount' => array(
443 'name' => 'discount_amount',
444 'type' => CRM_Utils_Type
::T_INT
,
445 'title' => ts('Discount Amount') ,
446 'description' => 'Discount Amount',
450 'type' => CRM_Utils_Type
::T_INT
,
451 'title' => ts('Event Cart ID') ,
452 'description' => 'FK to civicrm_event_carts',
453 'FKClassName' => 'CRM_Event_Cart_DAO_Cart',
455 'must_wait' => array(
456 'name' => 'must_wait',
457 'type' => CRM_Utils_Type
::T_INT
,
458 'title' => ts('Must Wait on List') ,
459 'description' => 'On Waiting List',
463 return self
::$_fields;
466 * Returns an array containing, for each field, the arary key used for that
467 * field in self::$_fields.
471 static function &fieldKeys() {
472 if (!(self
::$_fieldKeys)) {
473 self
::$_fieldKeys = array(
474 'id' => 'participant_id',
475 'contact_id' => 'participant_contact_id',
476 'event_id' => 'event_id',
477 'status_id' => 'participant_status_id',
478 'role_id' => 'participant_role_id',
479 'register_date' => 'participant_register_date',
480 'source' => 'participant_source',
481 'fee_level' => 'participant_fee_level',
482 'is_test' => 'participant_is_test',
483 'is_pay_later' => 'participant_is_pay_later',
484 'fee_amount' => 'participant_fee_amount',
485 'registered_by_id' => 'participant_registered_by_id',
486 'discount_id' => 'participant_discount_id',
487 'fee_currency' => 'participant_fee_currency',
488 'campaign_id' => 'participant_campaign_id',
489 'discount_amount' => 'discount_amount',
490 'cart_id' => 'cart_id',
491 'must_wait' => 'must_wait',
494 return self
::$_fieldKeys;
497 * Returns the names of this table
501 static function getTableName() {
502 return self
::$_tableName;
505 * Returns if this table needs to be logged
513 * Returns the list of fields that can be imported
515 * @param bool $prefix
519 static function &import($prefix = false) {
520 if (!(self
::$_import)) {
521 self
::$_import = array();
522 $fields = self
::fields();
523 foreach($fields as $name => $field) {
524 if (CRM_Utils_Array
::value('import', $field)) {
526 self
::$_import['participant'] = & $fields[$name];
528 self
::$_import[$name] = & $fields[$name];
533 return self
::$_import;
536 * Returns the list of fields that can be exported
538 * @param bool $prefix
542 static function &export($prefix = false) {
543 if (!(self
::$_export)) {
544 self
::$_export = array();
545 $fields = self
::fields();
546 foreach($fields as $name => $field) {
547 if (CRM_Utils_Array
::value('export', $field)) {
549 self
::$_export['participant'] = & $fields[$name];
551 self
::$_export[$name] = & $fields[$name];
556 return self
::$_export;