CRM-19130 - xml/templates/dao.tpl - Fire events for fields() and links()
[civicrm-core.git] / CRM / Event / DAO / ParticipantPayment.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
6| Copyright CiviCRM LLC (c) 2004-2016 |
7+--------------------------------------------------------------------+
8| This file is a part of CiviCRM. |
9| |
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. |
13| |
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. |
18| |
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+--------------------------------------------------------------------+
26*/
27/**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2016
30 *
31 * Generated from xml/schema/CRM/Event/ParticipantPayment.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
437fafcf 33 * (GenCodeChecksum:c007647ef27d75ac1b1bcdc74ac1a2b7)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
37class CRM_Event_DAO_ParticipantPayment extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_participant_payment';
44 /**
45 * static instance to hold the field values
46 *
47 * @var array
48 */
49 static $_fields = null;
e501603b
TO
50 /**
51 * static instance to hold the FK relationships
52 *
53 * @var string
54 */
55 static $_links = null;
e501603b
TO
56 /**
57 * static value to see if we should log any modifications to
58 * this table in the civicrm_log table
59 *
60 * @var boolean
61 */
62 static $_log = true;
63 /**
64 * Participant Payment Id
65 *
66 * @var int unsigned
67 */
68 public $id;
69 /**
70 * Participant Id (FK)
71 *
72 * @var int unsigned
73 */
74 public $participant_id;
75 /**
76 * FK to contribution table.
77 *
78 * @var int unsigned
79 */
80 public $contribution_id;
81 /**
82 * class constructor
83 *
84 * @return civicrm_participant_payment
85 */
86 function __construct() {
87 $this->__table = 'civicrm_participant_payment';
88 parent::__construct();
89 }
90 /**
91 * Returns foreign keys and entity references
92 *
93 * @return array
94 * [CRM_Core_Reference_Interface]
95 */
96 static function getReferenceColumns() {
97 if (!self::$_links) {
98 self::$_links = static ::createReferenceColumns(__CLASS__);
99 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'participant_id', 'civicrm_participant', 'id');
100 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_id', 'civicrm_contribution', 'id');
101 }
102 return self::$_links;
103 }
104 /**
105 * Returns all the column names of this table
106 *
107 * @return array
108 */
109 static function &fields() {
110 if (!(self::$_fields)) {
111 self::$_fields = array(
112 'id' => array(
113 'name' => 'id',
114 'type' => CRM_Utils_Type::T_INT,
115 'title' => ts('Payment ID') ,
116 'description' => 'Participant Payment Id',
117 'required' => true,
118 ) ,
119 'participant_id' => array(
120 'name' => 'participant_id',
121 'type' => CRM_Utils_Type::T_INT,
122 'title' => ts('Participant ID') ,
123 'description' => 'Participant Id (FK)',
124 'required' => true,
125 'FKClassName' => 'CRM_Event_DAO_Participant',
126 ) ,
127 'contribution_id' => array(
128 'name' => 'contribution_id',
129 'type' => CRM_Utils_Type::T_INT,
130 'title' => ts('Contribution') ,
131 'description' => 'FK to contribution table.',
132 'required' => true,
133 'FKClassName' => 'CRM_Contribute_DAO_Contribution',
134 ) ,
135 );
136 }
137 return self::$_fields;
138 }
139 /**
bd8e0b14 140 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
141 *
142 * @return array
bd8e0b14 143 * Array(string $name => string $uniqueName).
e501603b
TO
144 */
145 static function &fieldKeys() {
bd8e0b14
TO
146 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
147 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 148 }
bd8e0b14 149 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
150 }
151 /**
152 * Returns the names of this table
153 *
154 * @return string
155 */
156 static function getTableName() {
157 return self::$_tableName;
158 }
159 /**
160 * Returns if this table needs to be logged
161 *
162 * @return boolean
163 */
164 function getLog() {
165 return self::$_log;
166 }
167 /**
168 * Returns the list of fields that can be imported
169 *
170 * @param bool $prefix
171 *
172 * @return array
173 */
174 static function &import($prefix = false) {
60808919
TO
175 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'participant_payment', $prefix, array());
176 return $r;
e501603b
TO
177 }
178 /**
179 * Returns the list of fields that can be exported
180 *
181 * @param bool $prefix
182 *
183 * @return array
184 */
185 static function &export($prefix = false) {
60808919
TO
186 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'participant_payment', $prefix, array());
187 return $r;
e501603b
TO
188 }
189}