5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Event/ParticipantPayment.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:46b1d29e4240673e67e23252fd2a1e1b)
13 * Database access object for the ParticipantPayment entity.
15 class CRM_Event_DAO_ParticipantPayment
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.7';
18 const COMPONENT
= 'CiviEvent';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_participant_payment';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = TRUE;
35 * Participant Payment Id
46 public $participant_id;
49 * FK to contribution table.
53 public $contribution_id;
58 public function __construct() {
59 $this->__table
= 'civicrm_participant_payment';
60 parent
::__construct();
64 * Returns localized title of this entity.
67 * Whether to return the plural version of the title.
69 public static function getEntityTitle($plural = FALSE) {
70 return $plural ?
ts('Participant Payments') : ts('Participant Payment');
74 * Returns foreign keys and entity references.
77 * [CRM_Core_Reference_Interface]
79 public static function getReferenceColumns() {
80 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
81 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
82 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'participant_id', 'civicrm_participant', 'id');
83 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contribution_id', 'civicrm_contribution', 'id');
84 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
86 return Civi
::$statics[__CLASS__
]['links'];
90 * Returns all the column names of this table
94 public static function &fields() {
95 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
96 Civi
::$statics[__CLASS__
]['fields'] = [
99 'type' => CRM_Utils_Type
::T_INT
,
100 'title' => ts('Payment ID'),
101 'description' => ts('Participant Payment Id'),
103 'where' => 'civicrm_participant_payment.id',
104 'table_name' => 'civicrm_participant_payment',
105 'entity' => 'ParticipantPayment',
106 'bao' => 'CRM_Event_BAO_ParticipantPayment',
110 'participant_id' => [
111 'name' => 'participant_id',
112 'type' => CRM_Utils_Type
::T_INT
,
113 'title' => ts('Participant ID'),
114 'description' => ts('Participant Id (FK)'),
116 'where' => 'civicrm_participant_payment.participant_id',
117 'table_name' => 'civicrm_participant_payment',
118 'entity' => 'ParticipantPayment',
119 'bao' => 'CRM_Event_BAO_ParticipantPayment',
121 'FKClassName' => 'CRM_Event_DAO_Participant',
124 'contribution_id' => [
125 'name' => 'contribution_id',
126 'type' => CRM_Utils_Type
::T_INT
,
127 'title' => ts('Contribution'),
128 'description' => ts('FK to contribution table.'),
130 'where' => 'civicrm_participant_payment.contribution_id',
131 'table_name' => 'civicrm_participant_payment',
132 'entity' => 'ParticipantPayment',
133 'bao' => 'CRM_Event_BAO_ParticipantPayment',
135 'FKClassName' => 'CRM_Contribute_DAO_Contribution',
139 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
141 return Civi
::$statics[__CLASS__
]['fields'];
145 * Return a mapping from field-name to the corresponding key (as used in fields()).
148 * Array(string $name => string $uniqueName).
150 public static function &fieldKeys() {
151 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
152 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
154 return Civi
::$statics[__CLASS__
]['fieldKeys'];
158 * Returns the names of this table
162 public static function getTableName() {
163 return self
::$_tableName;
167 * Returns if this table needs to be logged
171 public function getLog() {
176 * Returns the list of fields that can be imported
178 * @param bool $prefix
182 public static function &import($prefix = FALSE) {
183 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'participant_payment', $prefix, []);
188 * Returns the list of fields that can be exported
190 * @param bool $prefix
194 public static function &export($prefix = FALSE) {
195 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'participant_payment', $prefix, []);
200 * Returns the list of indices
202 * @param bool $localize
206 public static function indices($localize = TRUE) {
208 'UI_contribution_participant' => [
209 'name' => 'UI_contribution_participant',
211 0 => 'contribution_id',
212 1 => 'participant_id',
214 'localizable' => FALSE,
216 'sig' => 'civicrm_participant_payment::1::contribution_id::participant_id',
219 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;