3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Pledge/PledgePayment.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:37953335e5e08db4328298ec003c97a8)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Pledge_DAO_PledgePayment constructor.
40 class CRM_Pledge_DAO_PledgePayment
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_pledge_payment';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
65 * FK to contribution table.
69 public $contribution_id;
71 * Pledged amount for this payment (the actual contribution amount might be different).
75 public $scheduled_amount;
77 * Actual amount that is paid as the Pledged installment amount.
81 public $actual_amount;
83 * 3 character string, value from config setting or input via user.
89 * The date the pledge payment is supposed to happen.
93 public $scheduled_date;
95 * The date that the most recent payment reminder was sent.
99 public $reminder_date;
101 * The number of payment reminders sent.
105 public $reminder_count;
114 function __construct() {
115 $this->__table
= 'civicrm_pledge_payment';
116 parent
::__construct();
119 * Returns foreign keys and entity references.
122 * [CRM_Core_Reference_Interface]
124 static function getReferenceColumns() {
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']);
131 return Civi
::$statics[__CLASS__
]['links'];
134 * Returns all the column names of this table
138 static function &fields() {
139 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
140 Civi
::$statics[__CLASS__
]['fields'] = array(
141 'pledge_payment_id' => array(
143 'type' => CRM_Utils_Type
::T_INT
,
144 'title' => ts('Payment ID') ,
147 'where' => 'civicrm_pledge_payment.id',
148 'headerPattern' => '',
151 'table_name' => 'civicrm_pledge_payment',
152 'entity' => 'PledgePayment',
153 'bao' => 'CRM_Pledge_BAO_PledgePayment',
156 'pledge_id' => array(
157 'name' => 'pledge_id',
158 'type' => CRM_Utils_Type
::T_INT
,
159 'title' => ts('Pledge') ,
160 'description' => 'FK to Pledge table',
162 'table_name' => 'civicrm_pledge_payment',
163 'entity' => 'PledgePayment',
164 'bao' => 'CRM_Pledge_BAO_PledgePayment',
166 'FKClassName' => 'CRM_Pledge_DAO_Pledge',
168 'contribution_id' => array(
169 'name' => 'contribution_id',
170 'type' => CRM_Utils_Type
::T_INT
,
171 'title' => ts('Contribution') ,
172 'description' => 'FK to contribution table.',
173 'table_name' => 'civicrm_pledge_payment',
174 'entity' => 'PledgePayment',
175 'bao' => 'CRM_Pledge_BAO_PledgePayment',
177 'FKClassName' => 'CRM_Contribute_DAO_Contribution',
179 'pledge_payment_scheduled_amount' => array(
180 'name' => 'scheduled_amount',
181 'type' => CRM_Utils_Type
::T_MONEY
,
182 'title' => ts('Scheduled Amount') ,
183 'description' => 'Pledged amount for this payment (the actual contribution amount might be different).',
185 'precision' => array(
190 'where' => 'civicrm_pledge_payment.scheduled_amount',
191 'headerPattern' => '',
194 'table_name' => 'civicrm_pledge_payment',
195 'entity' => 'PledgePayment',
196 'bao' => 'CRM_Pledge_BAO_PledgePayment',
199 'pledge_payment_actual_amount' => array(
200 'name' => 'actual_amount',
201 'type' => CRM_Utils_Type
::T_MONEY
,
202 'title' => ts('Actual Amount') ,
203 'description' => 'Actual amount that is paid as the Pledged installment amount.',
204 'precision' => array(
209 'where' => 'civicrm_pledge_payment.actual_amount',
210 'headerPattern' => '',
213 'table_name' => 'civicrm_pledge_payment',
214 'entity' => 'PledgePayment',
215 'bao' => 'CRM_Pledge_BAO_PledgePayment',
219 'name' => 'currency',
220 'type' => CRM_Utils_Type
::T_STRING
,
221 'title' => ts('Currency') ,
222 'description' => '3 character string, value from config setting or input via user.',
224 'size' => CRM_Utils_Type
::FOUR
,
226 'table_name' => 'civicrm_pledge_payment',
227 'entity' => 'PledgePayment',
228 'bao' => 'CRM_Pledge_BAO_PledgePayment',
233 'pseudoconstant' => array(
234 'table' => 'civicrm_currency',
235 'keyColumn' => 'name',
236 'labelColumn' => 'full_name',
237 'nameColumn' => 'name',
240 'pledge_payment_scheduled_date' => array(
241 'name' => 'scheduled_date',
242 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
243 'title' => ts('Scheduled Date') ,
244 'description' => 'The date the pledge payment is supposed to happen.',
247 'where' => 'civicrm_pledge_payment.scheduled_date',
248 'headerPattern' => '',
251 'table_name' => 'civicrm_pledge_payment',
252 'entity' => 'PledgePayment',
253 'bao' => 'CRM_Pledge_BAO_PledgePayment',
256 'pledge_payment_reminder_date' => array(
257 'name' => 'reminder_date',
258 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
259 'title' => ts('Last Reminder') ,
260 'description' => 'The date that the most recent payment reminder was sent.',
262 'where' => 'civicrm_pledge_payment.reminder_date',
263 'headerPattern' => '',
266 'table_name' => 'civicrm_pledge_payment',
267 'entity' => 'PledgePayment',
268 'bao' => 'CRM_Pledge_BAO_PledgePayment',
271 'pledge_payment_reminder_count' => array(
272 'name' => 'reminder_count',
273 'type' => CRM_Utils_Type
::T_INT
,
274 'title' => ts('Reminders Sent') ,
275 'description' => 'The number of payment reminders sent.',
277 'where' => 'civicrm_pledge_payment.reminder_count',
278 'headerPattern' => '',
281 'table_name' => 'civicrm_pledge_payment',
282 'entity' => 'PledgePayment',
283 'bao' => 'CRM_Pledge_BAO_PledgePayment',
286 'pledge_payment_status_id' => array(
287 'name' => 'status_id',
288 'type' => CRM_Utils_Type
::T_INT
,
289 'title' => ts('Payment Status') ,
291 'where' => 'civicrm_pledge_payment.status_id',
292 'headerPattern' => '',
295 'table_name' => 'civicrm_pledge_payment',
296 'entity' => 'PledgePayment',
297 'bao' => 'CRM_Pledge_BAO_PledgePayment',
299 'pseudoconstant' => array(
300 'optionGroupName' => 'contribution_status',
301 'optionEditPath' => 'civicrm/admin/options/contribution_status',
305 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
307 return Civi
::$statics[__CLASS__
]['fields'];
310 * Return a mapping from field-name to the corresponding key (as used in fields()).
313 * Array(string $name => string $uniqueName).
315 static function &fieldKeys() {
316 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
317 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
319 return Civi
::$statics[__CLASS__
]['fieldKeys'];
322 * Returns the names of this table
326 static function getTableName() {
327 return self
::$_tableName;
330 * Returns if this table needs to be logged
338 * Returns the list of fields that can be imported
340 * @param bool $prefix
344 static function &import($prefix = false) {
345 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'pledge_payment', $prefix, array());
349 * Returns the list of fields that can be exported
351 * @param bool $prefix
355 static function &export($prefix = false) {
356 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'pledge_payment', $prefix, array());
360 * Returns the list of indices
362 public static function indices($localize = TRUE) {
364 'index_contribution_pledge' => array(
365 'name' => 'index_contribution_pledge',
367 0 => 'contribution_id',
370 'localizable' => false,
371 'sig' => 'civicrm_pledge_payment::0::contribution_id::pledge_id',
373 'index_status' => array(
374 'name' => 'index_status',
378 'localizable' => false,
379 'sig' => 'civicrm_pledge_payment::0::status_id',
382 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;