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:faf8b6394f4e57dd2bd6702f712f7157)
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',
114 'participant_id' => [
115 'name' => 'participant_id',
116 'type' => CRM_Utils_Type
::T_INT
,
117 'title' => ts('Participant ID'),
118 'description' => ts('Participant ID (FK)'),
120 'where' => 'civicrm_participant_payment.participant_id',
121 'table_name' => 'civicrm_participant_payment',
122 'entity' => 'ParticipantPayment',
123 'bao' => 'CRM_Event_BAO_ParticipantPayment',
125 'FKClassName' => 'CRM_Event_DAO_Participant',
127 'label' => ts("Participant"),
131 'contribution_id' => [
132 'name' => 'contribution_id',
133 'type' => CRM_Utils_Type
::T_INT
,
134 'title' => ts('Contribution ID'),
135 'description' => ts('FK to contribution table.'),
137 'where' => 'civicrm_participant_payment.contribution_id',
138 'table_name' => 'civicrm_participant_payment',
139 'entity' => 'ParticipantPayment',
140 'bao' => 'CRM_Event_BAO_ParticipantPayment',
142 'FKClassName' => 'CRM_Contribute_DAO_Contribution',
144 'label' => ts("Contribution"),
149 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
151 return Civi
::$statics[__CLASS__
]['fields'];
155 * Return a mapping from field-name to the corresponding key (as used in fields()).
158 * Array(string $name => string $uniqueName).
160 public static function &fieldKeys() {
161 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
162 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
164 return Civi
::$statics[__CLASS__
]['fieldKeys'];
168 * Returns the names of this table
172 public static function getTableName() {
173 return self
::$_tableName;
177 * Returns if this table needs to be logged
181 public function getLog() {
186 * Returns the list of fields that can be imported
188 * @param bool $prefix
192 public static function &import($prefix = FALSE) {
193 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'participant_payment', $prefix, []);
198 * Returns the list of fields that can be exported
200 * @param bool $prefix
204 public static function &export($prefix = FALSE) {
205 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'participant_payment', $prefix, []);
210 * Returns the list of indices
212 * @param bool $localize
216 public static function indices($localize = TRUE) {
218 'UI_contribution_participant' => [
219 'name' => 'UI_contribution_participant',
221 0 => 'contribution_id',
222 1 => 'participant_id',
224 'localizable' => FALSE,
226 'sig' => 'civicrm_participant_payment::1::contribution_id::participant_id',
229 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;