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/Contribute/ContributionSoft.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:ea8abcdf53630758c538439bb186c717)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Contribute_DAO_ContributionSoft
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_contribution_soft';
45 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the keys used in $_fields for each field.
55 static $_fieldKeys = null;
57 * static instance to hold the FK relationships
61 static $_links = null;
63 * static value to see if we should log any modifications to
64 * this table in the civicrm_log table
70 * Soft Contribution ID
76 * FK to contribution table.
80 public $contribution_id;
88 * Amount of this soft contribution.
94 * 3 character string, value from config setting or input via user.
100 * FK to civicrm_pcp.id
109 public $pcp_display_in_roll;
114 public $pcp_roll_nickname;
119 public $pcp_personal_note;
121 * Soft Credit Type ID.Implicit FK to civicrm_option_value where option_group = soft_credit_type.
125 public $soft_credit_type_id;
129 * @return civicrm_contribution_soft
131 function __construct() {
132 $this->__table
= 'civicrm_contribution_soft';
133 parent
::__construct();
136 * Returns foreign keys and entity references
139 * [CRM_Core_Reference_Interface]
141 static function getReferenceColumns() {
142 if (!self
::$_links) {
143 self
::$_links = static ::createReferenceColumns(__CLASS__
);
144 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contribution_id', 'civicrm_contribution', 'id');
145 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contact_id', 'civicrm_contact', 'id');
146 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'pcp_id', 'civicrm_pcp', 'id');
148 return self
::$_links;
151 * Returns all the column names of this table
155 static function &fields() {
156 if (!(self
::$_fields)) {
157 self
::$_fields = array(
158 'contribution_soft_id' => array(
160 'type' => CRM_Utils_Type
::T_INT
,
161 'title' => ts('Soft Contribution ID') ,
162 'description' => 'Soft Contribution ID',
165 'where' => 'civicrm_contribution_soft.id',
166 'headerPattern' => '',
170 'contribution_id' => array(
171 'name' => 'contribution_id',
172 'type' => CRM_Utils_Type
::T_INT
,
173 'title' => ts('Soft Contribution - Contribution') ,
174 'description' => 'FK to contribution table.',
176 'FKClassName' => 'CRM_Contribute_DAO_Contribution',
178 'contribution_soft_contact_id' => array(
179 'name' => 'contact_id',
180 'type' => CRM_Utils_Type
::T_INT
,
181 'title' => ts('Contact ID') ,
182 'description' => 'FK to Contact ID',
185 'where' => 'civicrm_contribution_soft.contact_id',
186 'headerPattern' => '/contact(.?id)?/i',
187 'dataPattern' => '/^\d+$/',
189 'FKClassName' => 'CRM_Contact_DAO_Contact',
193 'type' => CRM_Utils_Type
::T_MONEY
,
194 'title' => ts('Soft Contribution Amount') ,
195 'description' => 'Amount of this soft contribution.',
197 'precision' => array(
202 'where' => 'civicrm_contribution_soft.amount',
203 'headerPattern' => '/total(.?am(ou)?nt)?/i',
204 'dataPattern' => '/^\d+(\.\d{2})?$/',
208 'name' => 'currency',
209 'type' => CRM_Utils_Type
::T_STRING
,
210 'title' => ts('Soft Contribution Currency') ,
211 'description' => '3 character string, value from config setting or input via user.',
213 'size' => CRM_Utils_Type
::FOUR
,
218 'pseudoconstant' => array(
219 'table' => 'civicrm_currency',
220 'keyColumn' => 'name',
221 'labelColumn' => 'full_name',
222 'nameColumn' => 'name',
227 'type' => CRM_Utils_Type
::T_INT
,
228 'title' => ts('Soft Contribution PCP') ,
229 'description' => 'FK to civicrm_pcp.id',
231 'FKClassName' => 'CRM_PCP_DAO_PCP',
232 'pseudoconstant' => array(
233 'table' => 'civicrm_pcp',
235 'labelColumn' => 'title',
238 'pcp_display_in_roll' => array(
239 'name' => 'pcp_display_in_roll',
240 'type' => CRM_Utils_Type
::T_BOOLEAN
,
241 'title' => ts('Soft Contribution Display on PCP') ,
243 'pcp_roll_nickname' => array(
244 'name' => 'pcp_roll_nickname',
245 'type' => CRM_Utils_Type
::T_STRING
,
246 'title' => ts('Soft Contribution PCP Nickname') ,
248 'size' => CRM_Utils_Type
::HUGE
,
251 'pcp_personal_note' => array(
252 'name' => 'pcp_personal_note',
253 'type' => CRM_Utils_Type
::T_STRING
,
254 'title' => ts('Soft Contribution PCP Note') ,
256 'size' => CRM_Utils_Type
::HUGE
,
259 'soft_credit_type_id' => array(
260 'name' => 'soft_credit_type_id',
261 'type' => CRM_Utils_Type
::T_INT
,
262 'title' => ts('Soft Credit Type') ,
263 'description' => 'Soft Credit Type ID.Implicit FK to civicrm_option_value where option_group = soft_credit_type.',
265 'pseudoconstant' => array(
266 'optionGroupName' => 'soft_credit_type',
267 'optionEditPath' => 'civicrm/admin/options/soft_credit_type',
272 return self
::$_fields;
275 * Returns an array containing, for each field, the arary key used for that
276 * field in self::$_fields.
280 static function &fieldKeys() {
281 if (!(self
::$_fieldKeys)) {
282 self
::$_fieldKeys = array(
283 'id' => 'contribution_soft_id',
284 'contribution_id' => 'contribution_id',
285 'contact_id' => 'contribution_soft_contact_id',
286 'amount' => 'amount',
287 'currency' => 'currency',
288 'pcp_id' => 'pcp_id',
289 'pcp_display_in_roll' => 'pcp_display_in_roll',
290 'pcp_roll_nickname' => 'pcp_roll_nickname',
291 'pcp_personal_note' => 'pcp_personal_note',
292 'soft_credit_type_id' => 'soft_credit_type_id',
295 return self
::$_fieldKeys;
298 * Returns the names of this table
302 static function getTableName() {
303 return self
::$_tableName;
306 * Returns if this table needs to be logged
314 * Returns the list of fields that can be imported
316 * @param bool $prefix
320 static function &import($prefix = false) {
321 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution_soft', $prefix, array());
325 * Returns the list of fields that can be exported
327 * @param bool $prefix
331 static function &export($prefix = false) {
332 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution_soft', $prefix, array());