Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
6b83d5bd | 5 | * @copyright CiviCRM LLC (c) 2004-2019 |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Event/ParticipantPayment.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
e380ee3b | 9 | * (GenCodeChecksum:33976e80c23c2f9eeaa844c812004b42) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the ParticipantPayment entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Event_DAO_ParticipantPayment extends CRM_Core_DAO { |
c3fc2621 | 16 | |
e501603b | 17 | /** |
f41f0342 | 18 | * Static instance to hold the table name. |
e501603b TO |
19 | * |
20 | * @var string | |
21 | */ | |
22 | static $_tableName = 'civicrm_participant_payment'; | |
c3fc2621 | 23 | |
e501603b | 24 | /** |
f41f0342 | 25 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 26 | * |
c3fc2621 | 27 | * @var bool |
e501603b | 28 | */ |
c3fc2621 CW |
29 | static $_log = TRUE; |
30 | ||
e501603b TO |
31 | /** |
32 | * Participant Payment Id | |
33 | * | |
34 | * @var int unsigned | |
35 | */ | |
36 | public $id; | |
c3fc2621 | 37 | |
e501603b TO |
38 | /** |
39 | * Participant Id (FK) | |
40 | * | |
41 | * @var int unsigned | |
42 | */ | |
43 | public $participant_id; | |
c3fc2621 | 44 | |
e501603b TO |
45 | /** |
46 | * FK to contribution table. | |
47 | * | |
48 | * @var int unsigned | |
49 | */ | |
50 | public $contribution_id; | |
c3fc2621 | 51 | |
e501603b | 52 | /** |
f41f0342 | 53 | * Class constructor. |
e501603b | 54 | */ |
c3fc2621 | 55 | public function __construct() { |
e501603b TO |
56 | $this->__table = 'civicrm_participant_payment'; |
57 | parent::__construct(); | |
58 | } | |
c3fc2621 | 59 | |
e501603b | 60 | /** |
f41f0342 | 61 | * Returns foreign keys and entity references. |
e501603b TO |
62 | * |
63 | * @return array | |
64 | * [CRM_Core_Reference_Interface] | |
65 | */ | |
c3fc2621 | 66 | public static function getReferenceColumns() { |
346aaaba TO |
67 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
68 | Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__); | |
c3fc2621 CW |
69 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'participant_id', 'civicrm_participant', 'id'); |
70 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contribution_id', 'civicrm_contribution', 'id'); | |
346aaaba | 71 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 72 | } |
346aaaba | 73 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 74 | } |
c3fc2621 | 75 | |
e501603b TO |
76 | /** |
77 | * Returns all the column names of this table | |
78 | * | |
79 | * @return array | |
80 | */ | |
c3fc2621 | 81 | public static function &fields() { |
346aaaba | 82 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
83 | Civi::$statics[__CLASS__]['fields'] = [ |
84 | 'id' => [ | |
e501603b TO |
85 | 'name' => 'id', |
86 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 87 | 'title' => ts('Payment ID'), |
215b423e | 88 | 'description' => ts('Participant Payment Id'), |
c3fc2621 | 89 | 'required' => TRUE, |
522a26c9 | 90 | 'table_name' => 'civicrm_participant_payment', |
91 | 'entity' => 'ParticipantPayment', | |
92 | 'bao' => 'CRM_Event_BAO_ParticipantPayment', | |
6a7e5e5d | 93 | 'localizable' => 0, |
c3fc2621 CW |
94 | ], |
95 | 'participant_id' => [ | |
e501603b TO |
96 | 'name' => 'participant_id', |
97 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 98 | 'title' => ts('Participant ID'), |
215b423e | 99 | 'description' => ts('Participant Id (FK)'), |
c3fc2621 | 100 | 'required' => TRUE, |
522a26c9 | 101 | 'table_name' => 'civicrm_participant_payment', |
102 | 'entity' => 'ParticipantPayment', | |
103 | 'bao' => 'CRM_Event_BAO_ParticipantPayment', | |
6a7e5e5d | 104 | 'localizable' => 0, |
e501603b | 105 | 'FKClassName' => 'CRM_Event_DAO_Participant', |
c3fc2621 CW |
106 | ], |
107 | 'contribution_id' => [ | |
e501603b TO |
108 | 'name' => 'contribution_id', |
109 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 110 | 'title' => ts('Contribution'), |
215b423e | 111 | 'description' => ts('FK to contribution table.'), |
c3fc2621 | 112 | 'required' => TRUE, |
522a26c9 | 113 | 'table_name' => 'civicrm_participant_payment', |
114 | 'entity' => 'ParticipantPayment', | |
115 | 'bao' => 'CRM_Event_BAO_ParticipantPayment', | |
6a7e5e5d | 116 | 'localizable' => 0, |
e501603b | 117 | 'FKClassName' => 'CRM_Contribute_DAO_Contribution', |
c3fc2621 CW |
118 | ], |
119 | ]; | |
346aaaba | 120 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 121 | } |
346aaaba | 122 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 123 | } |
c3fc2621 | 124 | |
e501603b | 125 | /** |
bd8e0b14 | 126 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
127 | * |
128 | * @return array | |
bd8e0b14 | 129 | * Array(string $name => string $uniqueName). |
e501603b | 130 | */ |
c3fc2621 | 131 | public static function &fieldKeys() { |
bd8e0b14 TO |
132 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
133 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 134 | } |
bd8e0b14 | 135 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 136 | } |
c3fc2621 | 137 | |
e501603b TO |
138 | /** |
139 | * Returns the names of this table | |
140 | * | |
141 | * @return string | |
142 | */ | |
c3fc2621 | 143 | public static function getTableName() { |
e501603b TO |
144 | return self::$_tableName; |
145 | } | |
c3fc2621 | 146 | |
e501603b TO |
147 | /** |
148 | * Returns if this table needs to be logged | |
149 | * | |
c3fc2621 | 150 | * @return bool |
e501603b | 151 | */ |
c3fc2621 | 152 | public function getLog() { |
e501603b TO |
153 | return self::$_log; |
154 | } | |
c3fc2621 | 155 | |
e501603b TO |
156 | /** |
157 | * Returns the list of fields that can be imported | |
158 | * | |
159 | * @param bool $prefix | |
160 | * | |
161 | * @return array | |
162 | */ | |
c3fc2621 CW |
163 | public static function &import($prefix = FALSE) { |
164 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'participant_payment', $prefix, []); | |
60808919 | 165 | return $r; |
e501603b | 166 | } |
c3fc2621 | 167 | |
e501603b TO |
168 | /** |
169 | * Returns the list of fields that can be exported | |
170 | * | |
171 | * @param bool $prefix | |
172 | * | |
173 | * @return array | |
174 | */ | |
c3fc2621 CW |
175 | public static function &export($prefix = FALSE) { |
176 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'participant_payment', $prefix, []); | |
60808919 | 177 | return $r; |
e501603b | 178 | } |
c3fc2621 | 179 | |
e7a6b91a AS |
180 | /** |
181 | * Returns the list of indices | |
c3fc2621 CW |
182 | * |
183 | * @param bool $localize | |
184 | * | |
185 | * @return array | |
e7a6b91a AS |
186 | */ |
187 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
188 | $indices = [ |
189 | 'UI_contribution_participant' => [ | |
e7a6b91a | 190 | 'name' => 'UI_contribution_participant', |
c3fc2621 | 191 | 'field' => [ |
e7a6b91a AS |
192 | 0 => 'contribution_id', |
193 | 1 => 'participant_id', | |
c3fc2621 CW |
194 | ], |
195 | 'localizable' => FALSE, | |
196 | 'unique' => TRUE, | |
e7a6b91a | 197 | 'sig' => 'civicrm_participant_payment::1::contribution_id::participant_id', |
c3fc2621 CW |
198 | ], |
199 | ]; | |
e7a6b91a AS |
200 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
201 | } | |
c3fc2621 | 202 | |
e501603b | 203 | } |