__table = 'civicrm_participant'; parent::__construct(); } /** * Returns foreign keys and entity references. * * @return array * [CRM_Core_Reference_Interface] */ static function getReferenceColumns() { if (!isset(Civi::$statics[__CLASS__]['links'])) { Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__); Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'event_id', 'civicrm_event', 'id'); Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'status_id', 'civicrm_participant_status_type', 'id'); Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'registered_by_id', 'civicrm_participant', 'id'); Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'discount_id', 'civicrm_discount', 'id'); Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', 'id'); Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'cart_id', 'civicrm_event_carts', 'id'); Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'transferred_to_contact_id', 'civicrm_contact', 'id'); CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); } return Civi::$statics[__CLASS__]['links']; } /** * Returns all the column names of this table * * @return array */ static function &fields() { if (!isset(Civi::$statics[__CLASS__]['fields'])) { Civi::$statics[__CLASS__]['fields'] = array( 'participant_id' => array( 'name' => 'id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Participant ID') , 'description' => 'Participant Id', 'required' => true, 'import' => true, 'where' => 'civicrm_participant.id', 'headerPattern' => '/(^(participant(.)?)?id$)/i', 'dataPattern' => '', 'export' => true, 'table_name' => 'civicrm_participant', 'entity' => 'Participant', 'bao' => 'CRM_Event_BAO_Participant', ) , 'participant_contact_id' => array( 'name' => 'contact_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Contact ID') , 'description' => 'FK to Contact ID', 'required' => true, 'import' => true, 'where' => 'civicrm_participant.contact_id', 'headerPattern' => '/contact(.?id)?/i', 'dataPattern' => '', 'export' => true, 'table_name' => 'civicrm_participant', 'entity' => 'Participant', 'bao' => 'CRM_Event_BAO_Participant', 'FKClassName' => 'CRM_Contact_DAO_Contact', ) , 'event_id' => array( 'name' => 'event_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Event') , 'description' => 'FK to Event ID', 'required' => true, 'import' => true, 'where' => 'civicrm_participant.event_id', 'headerPattern' => '/event id$/i', 'dataPattern' => '', 'export' => true, 'table_name' => 'civicrm_participant', 'entity' => 'Participant', 'bao' => 'CRM_Event_BAO_Participant', 'FKClassName' => 'CRM_Event_DAO_Event', ) , 'participant_status_id' => array( 'name' => 'status_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Participant Status') , 'description' => 'Participant status ID. FK to civicrm_participant_status_type. Default of 1 should map to status = Registered.', 'required' => true, 'import' => true, 'where' => 'civicrm_participant.status_id', 'headerPattern' => '/(participant.)?(status)$/i', 'dataPattern' => '', 'export' => true, 'default' => '1', 'table_name' => 'civicrm_participant', 'entity' => 'Participant', 'bao' => 'CRM_Event_BAO_Participant', 'FKClassName' => 'CRM_Event_DAO_ParticipantStatusType', 'html' => array( 'type' => 'Select', ) , 'pseudoconstant' => array( 'table' => 'civicrm_participant_status_type', 'keyColumn' => 'id', 'labelColumn' => 'label', ) ) , 'participant_role_id' => array( 'name' => 'role_id', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Participant Role') , 'description' => 'Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.', 'maxlength' => 128, 'size' => CRM_Utils_Type::HUGE, 'import' => true, 'where' => 'civicrm_participant.role_id', 'headerPattern' => '/(participant.)?(role)$/i', 'dataPattern' => '', 'export' => true, 'default' => 'NULL', 'table_name' => 'civicrm_participant', 'entity' => 'Participant', 'bao' => 'CRM_Event_BAO_Participant', 'html' => array( 'type' => 'Select', ) , 'pseudoconstant' => array( 'optionGroupName' => 'participant_role', 'optionEditPath' => 'civicrm/admin/options/participant_role', ) ) , 'participant_register_date' => array( 'name' => 'register_date', 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, 'title' => ts('Register date') , 'description' => 'When did contact register for event?', 'import' => true, 'where' => 'civicrm_participant.register_date', 'headerPattern' => '/^(r(egister\s)?date)$/i', 'dataPattern' => '', 'export' => true, 'table_name' => 'civicrm_participant', 'entity' => 'Participant', 'bao' => 'CRM_Event_BAO_Participant', 'html' => array( 'type' => 'Select Date', 'formatType' => 'activityDateTime', ) , ) , 'participant_source' => array( 'name' => 'source', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Participant Source') , 'description' => 'Source of this event registration.', 'maxlength' => 128, 'size' => CRM_Utils_Type::HUGE, 'import' => true, 'where' => 'civicrm_participant.source', 'headerPattern' => '/(participant.)?(source)$/i', 'dataPattern' => '', 'export' => true, 'table_name' => 'civicrm_participant', 'entity' => 'Participant', 'bao' => 'CRM_Event_BAO_Participant', ) , 'participant_fee_level' => array( 'name' => 'fee_level', 'type' => CRM_Utils_Type::T_TEXT, 'title' => ts('Fee level') , 'description' => 'Populate with the label (text) associated with a fee level for paid events with multiple levels. Note that we store the label value and not the key ', 'import' => true, 'where' => 'civicrm_participant.fee_level', 'headerPattern' => '/^(f(ee\s)?level)$/i', 'dataPattern' => '', 'export' => true, 'table_name' => 'civicrm_participant', 'entity' => 'Participant', 'bao' => 'CRM_Event_BAO_Participant', ) , 'participant_is_test' => array( 'name' => 'is_test', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Test') , 'import' => true, 'where' => 'civicrm_participant.is_test', 'headerPattern' => '', 'dataPattern' => '', 'export' => true, 'table_name' => 'civicrm_participant', 'entity' => 'Participant', 'bao' => 'CRM_Event_BAO_Participant', ) , 'participant_is_pay_later' => array( 'name' => 'is_pay_later', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Is Pay Later') , 'import' => true, 'where' => 'civicrm_participant.is_pay_later', 'headerPattern' => '/(is.)?(pay(.)?later)$/i', 'dataPattern' => '', 'export' => true, 'table_name' => 'civicrm_participant', 'entity' => 'Participant', 'bao' => 'CRM_Event_BAO_Participant', ) , 'participant_fee_amount' => array( 'name' => 'fee_amount', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Fee Amount') , 'description' => 'actual processor fee if known - may be 0.', 'precision' => array( 20, 2 ) , 'import' => true, 'where' => 'civicrm_participant.fee_amount', 'headerPattern' => '/fee(.?am(ou)?nt)?/i', 'dataPattern' => '/^\d+(\.\d{2})?$/', 'export' => true, 'table_name' => 'civicrm_participant', 'entity' => 'Participant', 'bao' => 'CRM_Event_BAO_Participant', ) , 'participant_registered_by_id' => array( 'name' => 'registered_by_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Registered By ID') , 'description' => 'FK to Participant ID', 'import' => true, 'where' => 'civicrm_participant.registered_by_id', 'headerPattern' => '', 'dataPattern' => '', 'export' => true, 'default' => 'NULL', 'table_name' => 'civicrm_participant', 'entity' => 'Participant', 'bao' => 'CRM_Event_BAO_Participant', 'FKClassName' => 'CRM_Event_DAO_Participant', ) , 'participant_discount_id' => array( 'name' => 'discount_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Discount ID') , 'description' => 'FK to Discount ID', 'default' => 'NULL', 'table_name' => 'civicrm_participant', 'entity' => 'Participant', 'bao' => 'CRM_Event_BAO_Participant', 'FKClassName' => 'CRM_Core_DAO_Discount', ) , 'participant_fee_currency' => array( 'name' => 'fee_currency', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Fee Currency') , 'description' => '3 character string, value derived from config setting.', 'maxlength' => 3, 'size' => CRM_Utils_Type::FOUR, 'import' => true, 'where' => 'civicrm_participant.fee_currency', 'headerPattern' => '/(fee)?.?cur(rency)?/i', 'dataPattern' => '/^[A-Z]{3}$/i', 'export' => true, 'default' => 'NULL', 'table_name' => 'civicrm_participant', 'entity' => 'Participant', 'bao' => 'CRM_Event_BAO_Participant', 'html' => array( 'type' => 'Select', ) , 'pseudoconstant' => array( 'table' => 'civicrm_currency', 'keyColumn' => 'name', 'labelColumn' => 'full_name', 'nameColumn' => 'name', ) ) , 'participant_campaign_id' => array( 'name' => 'campaign_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Campaign') , 'description' => 'The campaign for which this participant has been registered.', 'import' => true, 'where' => 'civicrm_participant.campaign_id', 'headerPattern' => '', 'dataPattern' => '', 'export' => true, 'table_name' => 'civicrm_participant', 'entity' => 'Participant', 'bao' => 'CRM_Event_BAO_Participant', 'FKClassName' => 'CRM_Campaign_DAO_Campaign', 'pseudoconstant' => array( 'table' => 'civicrm_campaign', 'keyColumn' => 'id', 'labelColumn' => 'title', ) ) , 'discount_amount' => array( 'name' => 'discount_amount', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Discount Amount') , 'description' => 'Discount Amount', 'table_name' => 'civicrm_participant', 'entity' => 'Participant', 'bao' => 'CRM_Event_BAO_Participant', ) , 'cart_id' => array( 'name' => 'cart_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Event Cart ID') , 'description' => 'FK to civicrm_event_carts', 'table_name' => 'civicrm_participant', 'entity' => 'Participant', 'bao' => 'CRM_Event_BAO_Participant', 'FKClassName' => 'CRM_Event_Cart_DAO_Cart', ) , 'must_wait' => array( 'name' => 'must_wait', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Must Wait on List') , 'description' => 'On Waiting List', 'table_name' => 'civicrm_participant', 'entity' => 'Participant', 'bao' => 'CRM_Event_BAO_Participant', ) , 'transferred_to_contact_id' => array( 'name' => 'transferred_to_contact_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Transferred to Contact ID') , 'description' => 'FK to Contact ID', 'import' => true, 'where' => 'civicrm_participant.transferred_to_contact_id', 'headerPattern' => '/transfer(.?id)?/i', 'dataPattern' => '', 'export' => true, 'default' => 'NULL', 'table_name' => 'civicrm_participant', 'entity' => 'Participant', 'bao' => 'CRM_Event_BAO_Participant', 'FKClassName' => 'CRM_Contact_DAO_Contact', ) , ); CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); } return Civi::$statics[__CLASS__]['fields']; } /** * Return a mapping from field-name to the corresponding key (as used in fields()). * * @return array * Array(string $name => string $uniqueName). */ static function &fieldKeys() { if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); } return Civi::$statics[__CLASS__]['fieldKeys']; } /** * Returns the names of this table * * @return string */ static function getTableName() { return self::$_tableName; } /** * Returns if this table needs to be logged * * @return boolean */ function getLog() { return self::$_log; } /** * Returns the list of fields that can be imported * * @param bool $prefix * * @return array */ static function &import($prefix = false) { $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'participant', $prefix, array()); return $r; } /** * Returns the list of fields that can be exported * * @param bool $prefix * * @return array */ static function &export($prefix = false) { $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'participant', $prefix, array()); return $r; } }