Merge pull request #8769 from totten/master-gencode-test
[civicrm-core.git] / CRM / Pledge / DAO / PledgePayment.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/Pledge/PledgePayment.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
437fafcf 33 * (GenCodeChecksum:61fd25d78097c2495d13be5336a17923)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
37class CRM_Pledge_DAO_PledgePayment extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_pledge_payment';
e501603b
TO
44 /**
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
47 *
48 * @var boolean
49 */
50 static $_log = true;
51 /**
52 *
53 * @var int unsigned
54 */
55 public $id;
56 /**
57 * FK to Pledge table
58 *
59 * @var int unsigned
60 */
61 public $pledge_id;
62 /**
63 * FK to contribution table.
64 *
65 * @var int unsigned
66 */
67 public $contribution_id;
68 /**
69 * Pledged amount for this payment (the actual contribution amount might be different).
70 *
71 * @var float
72 */
73 public $scheduled_amount;
74 /**
75 * Actual amount that is paid as the Pledged installment amount.
76 *
77 * @var float
78 */
79 public $actual_amount;
80 /**
81 * 3 character string, value from config setting or input via user.
82 *
83 * @var string
84 */
85 public $currency;
86 /**
87 * The date the pledge payment is supposed to happen.
88 *
89 * @var datetime
90 */
91 public $scheduled_date;
92 /**
93 * The date that the most recent payment reminder was sent.
94 *
95 * @var datetime
96 */
97 public $reminder_date;
98 /**
99 * The number of payment reminders sent.
100 *
101 * @var int unsigned
102 */
103 public $reminder_count;
104 /**
105 *
106 * @var int unsigned
107 */
108 public $status_id;
109 /**
110 * class constructor
111 *
112 * @return civicrm_pledge_payment
113 */
114 function __construct() {
115 $this->__table = 'civicrm_pledge_payment';
116 parent::__construct();
117 }
118 /**
119 * Returns foreign keys and entity references
120 *
121 * @return array
122 * [CRM_Core_Reference_Interface]
123 */
124 static function getReferenceColumns() {
346aaaba
TO
125 if (!isset(Civi::$statics[__CLASS__]['links'])) {
126 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
127 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'pledge_id', 'civicrm_pledge', 'id');
128 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_id', 'civicrm_contribution', 'id');
129 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 130 }
346aaaba 131 return Civi::$statics[__CLASS__]['links'];
e501603b
TO
132 }
133 /**
134 * Returns all the column names of this table
135 *
136 * @return array
137 */
138 static function &fields() {
346aaaba
TO
139 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
140 Civi::$statics[__CLASS__]['fields'] = array(
e501603b
TO
141 'pledge_payment_id' => array(
142 'name' => 'id',
143 'type' => CRM_Utils_Type::T_INT,
144 'title' => ts('Payment ID') ,
145 'required' => true,
146 'import' => true,
147 'where' => 'civicrm_pledge_payment.id',
148 'headerPattern' => '',
149 'dataPattern' => '',
150 'export' => true,
151 ) ,
152 'pledge_id' => array(
153 'name' => 'pledge_id',
154 'type' => CRM_Utils_Type::T_INT,
155 'title' => ts('Pledge') ,
156 'description' => 'FK to Pledge table',
157 'required' => true,
158 'FKClassName' => 'CRM_Pledge_DAO_Pledge',
159 ) ,
160 'contribution_id' => array(
161 'name' => 'contribution_id',
162 'type' => CRM_Utils_Type::T_INT,
163 'title' => ts('Contribution') ,
164 'description' => 'FK to contribution table.',
165 'FKClassName' => 'CRM_Contribute_DAO_Contribution',
166 ) ,
167 'pledge_payment_scheduled_amount' => array(
168 'name' => 'scheduled_amount',
169 'type' => CRM_Utils_Type::T_MONEY,
170 'title' => ts('Scheduled Amount') ,
171 'description' => 'Pledged amount for this payment (the actual contribution amount might be different).',
172 'required' => true,
173 'precision' => array(
174 20,
175 2
176 ) ,
177 'import' => true,
178 'where' => 'civicrm_pledge_payment.scheduled_amount',
179 'headerPattern' => '',
180 'dataPattern' => '',
181 'export' => true,
182 ) ,
183 'pledge_payment_actual_amount' => array(
184 'name' => 'actual_amount',
185 'type' => CRM_Utils_Type::T_MONEY,
186 'title' => ts('Actual Amount') ,
187 'description' => 'Actual amount that is paid as the Pledged installment amount.',
188 'precision' => array(
189 20,
190 2
191 ) ,
192 'import' => true,
193 'where' => 'civicrm_pledge_payment.actual_amount',
194 'headerPattern' => '',
195 'dataPattern' => '',
196 'export' => true,
197 ) ,
198 'currency' => array(
199 'name' => 'currency',
200 'type' => CRM_Utils_Type::T_STRING,
201 'title' => ts('Currency') ,
202 'description' => '3 character string, value from config setting or input via user.',
203 'maxlength' => 3,
204 'size' => CRM_Utils_Type::FOUR,
205 'default' => 'NULL',
206 'html' => array(
207 'type' => 'Select',
208 ) ,
209 'pseudoconstant' => array(
210 'table' => 'civicrm_currency',
211 'keyColumn' => 'name',
212 'labelColumn' => 'full_name',
213 'nameColumn' => 'name',
214 )
215 ) ,
216 'pledge_payment_scheduled_date' => array(
217 'name' => 'scheduled_date',
218 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
219 'title' => ts('Scheduled Date') ,
220 'description' => 'The date the pledge payment is supposed to happen.',
221 'required' => true,
222 'import' => true,
223 'where' => 'civicrm_pledge_payment.scheduled_date',
224 'headerPattern' => '',
225 'dataPattern' => '',
226 'export' => true,
227 ) ,
228 'pledge_payment_reminder_date' => array(
229 'name' => 'reminder_date',
230 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
231 'title' => ts('Last Reminder') ,
232 'description' => 'The date that the most recent payment reminder was sent.',
233 'import' => true,
234 'where' => 'civicrm_pledge_payment.reminder_date',
235 'headerPattern' => '',
236 'dataPattern' => '',
237 'export' => true,
238 ) ,
239 'pledge_payment_reminder_count' => array(
240 'name' => 'reminder_count',
241 'type' => CRM_Utils_Type::T_INT,
242 'title' => ts('Reminders Sent') ,
243 'description' => 'The number of payment reminders sent.',
244 'import' => true,
245 'where' => 'civicrm_pledge_payment.reminder_count',
246 'headerPattern' => '',
247 'dataPattern' => '',
248 'export' => true,
249 ) ,
250 'pledge_payment_status_id' => array(
251 'name' => 'status_id',
252 'type' => CRM_Utils_Type::T_INT,
253 'title' => ts('Payment Status') ,
254 'import' => true,
255 'where' => 'civicrm_pledge_payment.status_id',
256 'headerPattern' => '',
257 'dataPattern' => '',
258 'export' => false,
259 'pseudoconstant' => array(
260 'optionGroupName' => 'contribution_status',
261 'optionEditPath' => 'civicrm/admin/options/contribution_status',
262 )
263 ) ,
264 );
346aaaba 265 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 266 }
346aaaba 267 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
268 }
269 /**
bd8e0b14 270 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
271 *
272 * @return array
bd8e0b14 273 * Array(string $name => string $uniqueName).
e501603b
TO
274 */
275 static function &fieldKeys() {
bd8e0b14
TO
276 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
277 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 278 }
bd8e0b14 279 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
280 }
281 /**
282 * Returns the names of this table
283 *
284 * @return string
285 */
286 static function getTableName() {
287 return self::$_tableName;
288 }
289 /**
290 * Returns if this table needs to be logged
291 *
292 * @return boolean
293 */
294 function getLog() {
295 return self::$_log;
296 }
297 /**
298 * Returns the list of fields that can be imported
299 *
300 * @param bool $prefix
301 *
302 * @return array
303 */
304 static function &import($prefix = false) {
60808919
TO
305 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'pledge_payment', $prefix, array());
306 return $r;
e501603b
TO
307 }
308 /**
309 * Returns the list of fields that can be exported
310 *
311 * @param bool $prefix
312 *
313 * @return array
314 */
315 static function &export($prefix = false) {
60808919
TO
316 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'pledge_payment', $prefix, array());
317 return $r;
e501603b
TO
318 }
319}