3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
31 * Generated from xml/schema/CRM/Pledge/PledgePayment.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:61fd25d78097c2495d13be5336a17923)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Pledge_DAO_PledgePayment
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_pledge_payment';
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
63 * FK to contribution table.
67 public $contribution_id;
69 * Pledged amount for this payment (the actual contribution amount might be different).
73 public $scheduled_amount;
75 * Actual amount that is paid as the Pledged installment amount.
79 public $actual_amount;
81 * 3 character string, value from config setting or input via user.
87 * The date the pledge payment is supposed to happen.
91 public $scheduled_date;
93 * The date that the most recent payment reminder was sent.
97 public $reminder_date;
99 * The number of payment reminders sent.
103 public $reminder_count;
112 * @return civicrm_pledge_payment
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' => '',
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',
158 'FKClassName' => 'CRM_Pledge_DAO_Pledge',
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',
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).',
173 'precision' => array(
178 'where' => 'civicrm_pledge_payment.scheduled_amount',
179 'headerPattern' => '',
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(
193 'where' => 'civicrm_pledge_payment.actual_amount',
194 'headerPattern' => '',
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.',
204 'size' => CRM_Utils_Type
::FOUR
,
209 'pseudoconstant' => array(
210 'table' => 'civicrm_currency',
211 'keyColumn' => 'name',
212 'labelColumn' => 'full_name',
213 'nameColumn' => 'name',
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.',
223 'where' => 'civicrm_pledge_payment.scheduled_date',
224 'headerPattern' => '',
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.',
234 'where' => 'civicrm_pledge_payment.reminder_date',
235 'headerPattern' => '',
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.',
245 'where' => 'civicrm_pledge_payment.reminder_count',
246 'headerPattern' => '',
250 'pledge_payment_status_id' => array(
251 'name' => 'status_id',
252 'type' => CRM_Utils_Type
::T_INT
,
253 'title' => ts('Payment Status') ,
255 'where' => 'civicrm_pledge_payment.status_id',
256 'headerPattern' => '',
259 'pseudoconstant' => array(
260 'optionGroupName' => 'contribution_status',
261 'optionEditPath' => 'civicrm/admin/options/contribution_status',
265 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
267 return Civi
::$statics[__CLASS__
]['fields'];
270 * Return a mapping from field-name to the corresponding key (as used in fields()).
273 * Array(string $name => string $uniqueName).
275 static function &fieldKeys() {
276 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
277 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
279 return Civi
::$statics[__CLASS__
]['fieldKeys'];
282 * Returns the names of this table
286 static function getTableName() {
287 return self
::$_tableName;
290 * Returns if this table needs to be logged
298 * Returns the list of fields that can be imported
300 * @param bool $prefix
304 static function &import($prefix = false) {
305 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'pledge_payment', $prefix, array());
309 * Returns the list of fields that can be exported
311 * @param bool $prefix
315 static function &export($prefix = false) {
316 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'pledge_payment', $prefix, array());