3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
31 * Generated from xml/schema/CRM/Event/Participant.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:5c9653302e7cc416c68b794981f9f9b8)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Event_DAO_Participant
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_participant';
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
70 * Participant status ID. FK to civicrm_participant_status_type. Default of 1 should map to status = Registered.
76 * Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.
82 * When did contact register for event?
86 public $register_date;
88 * Source of this event registration.
94 * Populate with the label (text) associated with a fee level for paid events with multiple levels. Note that
95 we store the label value and not the key
109 public $is_pay_later;
111 * actual processor fee if known - may be 0.
117 * FK to Participant ID
121 public $registered_by_id;
129 * 3 character string, value derived from config setting.
133 public $fee_currency;
135 * The campaign for which this participant has been registered.
145 public $discount_amount;
147 * FK to civicrm_event_carts
163 public $transferred_to_contact_id;
167 * @return civicrm_participant
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',
214 'participant_contact_id' => array(
215 'name' => 'contact_id',
216 'type' => CRM_Utils_Type
::T_INT
,
217 'title' => ts('Contact ID') ,
218 'description' => 'FK to Contact ID',
221 'where' => 'civicrm_participant.contact_id',
222 'headerPattern' => '/contact(.?id)?/i',
225 'FKClassName' => 'CRM_Contact_DAO_Contact',
228 'name' => 'event_id',
229 'type' => CRM_Utils_Type
::T_INT
,
230 'title' => ts('Event') ,
231 'description' => 'FK to Event ID',
234 'where' => 'civicrm_participant.event_id',
235 'headerPattern' => '/event id$/i',
238 'FKClassName' => 'CRM_Event_DAO_Event',
240 'participant_status_id' => array(
241 'name' => 'status_id',
242 'type' => CRM_Utils_Type
::T_INT
,
243 'title' => ts('Participant Status') ,
244 'description' => 'Participant status ID. FK to civicrm_participant_status_type. Default of 1 should map to status = Registered.',
247 'where' => 'civicrm_participant.status_id',
248 'headerPattern' => '/(participant.)?(status)$/i',
252 'FKClassName' => 'CRM_Event_DAO_ParticipantStatusType',
256 'pseudoconstant' => array(
257 'table' => 'civicrm_participant_status_type',
259 'labelColumn' => 'label',
262 'participant_role_id' => array(
264 'type' => CRM_Utils_Type
::T_STRING
,
265 'title' => ts('Participant Role') ,
266 'description' => 'Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.',
268 'size' => CRM_Utils_Type
::HUGE
,
270 'where' => 'civicrm_participant.role_id',
271 'headerPattern' => '/(participant.)?(role)$/i',
278 'pseudoconstant' => array(
279 'optionGroupName' => 'participant_role',
280 'optionEditPath' => 'civicrm/admin/options/participant_role',
283 'participant_register_date' => array(
284 'name' => 'register_date',
285 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
286 'title' => ts('Register date') ,
287 'description' => 'When did contact register for event?',
289 'where' => 'civicrm_participant.register_date',
290 'headerPattern' => '/^(r(egister\s)?date)$/i',
294 'participant_source' => array(
296 'type' => CRM_Utils_Type
::T_STRING
,
297 'title' => ts('Participant Source') ,
298 'description' => 'Source of this event registration.',
300 'size' => CRM_Utils_Type
::HUGE
,
302 'where' => 'civicrm_participant.source',
303 'headerPattern' => '/(participant.)?(source)$/i',
307 'participant_fee_level' => array(
308 'name' => 'fee_level',
309 'type' => CRM_Utils_Type
::T_TEXT
,
310 'title' => ts('Fee level') ,
311 'description' => 'Populate with the label (text) associated with a fee level for paid events with multiple levels. Note that
312 we store the label value and not the key
315 'where' => 'civicrm_participant.fee_level',
316 'headerPattern' => '/^(f(ee\s)?level)$/i',
320 'participant_is_test' => array(
322 'type' => CRM_Utils_Type
::T_BOOLEAN
,
323 'title' => ts('Test') ,
325 'where' => 'civicrm_participant.is_test',
326 'headerPattern' => '',
330 'participant_is_pay_later' => array(
331 'name' => 'is_pay_later',
332 'type' => CRM_Utils_Type
::T_BOOLEAN
,
333 'title' => ts('Is Pay Later') ,
335 'where' => 'civicrm_participant.is_pay_later',
336 'headerPattern' => '/(is.)?(pay(.)?later)$/i',
340 'participant_fee_amount' => array(
341 'name' => 'fee_amount',
342 'type' => CRM_Utils_Type
::T_MONEY
,
343 'title' => ts('Fee Amount') ,
344 'description' => 'actual processor fee if known - may be 0.',
345 'precision' => array(
350 'where' => 'civicrm_participant.fee_amount',
351 'headerPattern' => '/fee(.?am(ou)?nt)?/i',
352 'dataPattern' => '/^\d+(\.\d{2})?$/',
355 'participant_registered_by_id' => array(
356 'name' => 'registered_by_id',
357 'type' => CRM_Utils_Type
::T_INT
,
358 'title' => ts('Registered By ID') ,
359 'description' => 'FK to Participant ID',
361 'where' => 'civicrm_participant.registered_by_id',
362 'headerPattern' => '',
366 'FKClassName' => 'CRM_Event_DAO_Participant',
368 'participant_discount_id' => array(
369 'name' => 'discount_id',
370 'type' => CRM_Utils_Type
::T_INT
,
371 'title' => ts('Discount ID') ,
372 'description' => 'FK to Discount ID',
374 'FKClassName' => 'CRM_Core_DAO_Discount',
376 'participant_fee_currency' => array(
377 'name' => 'fee_currency',
378 'type' => CRM_Utils_Type
::T_STRING
,
379 'title' => ts('Fee Currency') ,
380 'description' => '3 character string, value derived from config setting.',
382 'size' => CRM_Utils_Type
::FOUR
,
384 'where' => 'civicrm_participant.fee_currency',
385 'headerPattern' => '/(fee)?.?cur(rency)?/i',
386 'dataPattern' => '/^[A-Z]{3}$/i',
392 'pseudoconstant' => array(
393 'table' => 'civicrm_currency',
394 'keyColumn' => 'name',
395 'labelColumn' => 'full_name',
396 'nameColumn' => 'name',
399 'participant_campaign_id' => array(
400 'name' => 'campaign_id',
401 'type' => CRM_Utils_Type
::T_INT
,
402 'title' => ts('Campaign') ,
403 'description' => 'The campaign for which this participant has been registered.',
405 'where' => 'civicrm_participant.campaign_id',
406 'headerPattern' => '',
409 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
410 'pseudoconstant' => array(
411 'table' => 'civicrm_campaign',
413 'labelColumn' => 'title',
416 'discount_amount' => array(
417 'name' => 'discount_amount',
418 'type' => CRM_Utils_Type
::T_INT
,
419 'title' => ts('Discount Amount') ,
420 'description' => 'Discount Amount',
424 'type' => CRM_Utils_Type
::T_INT
,
425 'title' => ts('Event Cart ID') ,
426 'description' => 'FK to civicrm_event_carts',
427 'FKClassName' => 'CRM_Event_Cart_DAO_Cart',
429 'must_wait' => array(
430 'name' => 'must_wait',
431 'type' => CRM_Utils_Type
::T_INT
,
432 'title' => ts('Must Wait on List') ,
433 'description' => 'On Waiting List',
435 'transferred_to_contact_id' => array(
436 'name' => 'transferred_to_contact_id',
437 'type' => CRM_Utils_Type
::T_INT
,
438 'title' => ts('Transferred to Contact ID') ,
439 'description' => 'FK to Contact ID',
441 'where' => 'civicrm_participant.transferred_to_contact_id',
442 'headerPattern' => '/transfer(.?id)?/i',
446 'FKClassName' => 'CRM_Contact_DAO_Contact',
449 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
451 return Civi
::$statics[__CLASS__
]['fields'];
454 * Return a mapping from field-name to the corresponding key (as used in fields()).
457 * Array(string $name => string $uniqueName).
459 static function &fieldKeys() {
460 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
461 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
463 return Civi
::$statics[__CLASS__
]['fieldKeys'];
466 * Returns the names of this table
470 static function getTableName() {
471 return self
::$_tableName;
474 * Returns if this table needs to be logged
482 * Returns the list of fields that can be imported
484 * @param bool $prefix
488 static function &import($prefix = false) {
489 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'participant', $prefix, array());
493 * Returns the list of fields that can be exported
495 * @param bool $prefix
499 static function &export($prefix = false) {
500 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'participant', $prefix, array());