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 instance to hold the values that can
68 static $_import = null;
70 * static instance to hold the values that can
75 static $_export = null;
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
84 * Soft Contribution ID
90 * FK to contribution table.
94 public $contribution_id;
102 * Amount of this soft contribution.
108 * 3 character string, value from config setting or input via user.
114 * FK to civicrm_pcp.id
123 public $pcp_display_in_roll;
128 public $pcp_roll_nickname;
133 public $pcp_personal_note;
135 * Soft Credit Type ID.Implicit FK to civicrm_option_value where option_group = soft_credit_type.
139 public $soft_credit_type_id;
143 * @return civicrm_contribution_soft
145 function __construct() {
146 $this->__table
= 'civicrm_contribution_soft';
147 parent
::__construct();
150 * Returns foreign keys and entity references
153 * [CRM_Core_Reference_Interface]
155 static function getReferenceColumns() {
156 if (!self
::$_links) {
157 self
::$_links = static ::createReferenceColumns(__CLASS__
);
158 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contribution_id', 'civicrm_contribution', 'id');
159 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contact_id', 'civicrm_contact', 'id');
160 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'pcp_id', 'civicrm_pcp', 'id');
162 return self
::$_links;
165 * Returns all the column names of this table
169 static function &fields() {
170 if (!(self
::$_fields)) {
171 self
::$_fields = array(
172 'contribution_soft_id' => array(
174 'type' => CRM_Utils_Type
::T_INT
,
175 'title' => ts('Soft Contribution ID') ,
176 'description' => 'Soft Contribution ID',
179 'where' => 'civicrm_contribution_soft.id',
180 'headerPattern' => '',
184 'contribution_id' => array(
185 'name' => 'contribution_id',
186 'type' => CRM_Utils_Type
::T_INT
,
187 'title' => ts('Soft Contribution - Contribution') ,
188 'description' => 'FK to contribution table.',
190 'FKClassName' => 'CRM_Contribute_DAO_Contribution',
192 'contribution_soft_contact_id' => array(
193 'name' => 'contact_id',
194 'type' => CRM_Utils_Type
::T_INT
,
195 'title' => ts('Contact ID') ,
196 'description' => 'FK to Contact ID',
199 'where' => 'civicrm_contribution_soft.contact_id',
200 'headerPattern' => '/contact(.?id)?/i',
201 'dataPattern' => '/^\d+$/',
203 'FKClassName' => 'CRM_Contact_DAO_Contact',
207 'type' => CRM_Utils_Type
::T_MONEY
,
208 'title' => ts('Soft Contribution Amount') ,
209 'description' => 'Amount of this soft contribution.',
211 'precision' => array(
216 'where' => 'civicrm_contribution_soft.amount',
217 'headerPattern' => '/total(.?am(ou)?nt)?/i',
218 'dataPattern' => '/^\d+(\.\d{2})?$/',
222 'name' => 'currency',
223 'type' => CRM_Utils_Type
::T_STRING
,
224 'title' => ts('Soft Contribution Currency') ,
225 'description' => '3 character string, value from config setting or input via user.',
227 'size' => CRM_Utils_Type
::FOUR
,
232 'pseudoconstant' => array(
233 'table' => 'civicrm_currency',
234 'keyColumn' => 'name',
235 'labelColumn' => 'full_name',
236 'nameColumn' => 'name',
241 'type' => CRM_Utils_Type
::T_INT
,
242 'title' => ts('Soft Contribution PCP') ,
243 'description' => 'FK to civicrm_pcp.id',
245 'FKClassName' => 'CRM_PCP_DAO_PCP',
246 'pseudoconstant' => array(
247 'table' => 'civicrm_pcp',
249 'labelColumn' => 'title',
252 'pcp_display_in_roll' => array(
253 'name' => 'pcp_display_in_roll',
254 'type' => CRM_Utils_Type
::T_BOOLEAN
,
255 'title' => ts('Soft Contribution Display on PCP') ,
257 'pcp_roll_nickname' => array(
258 'name' => 'pcp_roll_nickname',
259 'type' => CRM_Utils_Type
::T_STRING
,
260 'title' => ts('Soft Contribution PCP Nickname') ,
262 'size' => CRM_Utils_Type
::HUGE
,
265 'pcp_personal_note' => array(
266 'name' => 'pcp_personal_note',
267 'type' => CRM_Utils_Type
::T_STRING
,
268 'title' => ts('Soft Contribution PCP Note') ,
270 'size' => CRM_Utils_Type
::HUGE
,
273 'soft_credit_type_id' => array(
274 'name' => 'soft_credit_type_id',
275 'type' => CRM_Utils_Type
::T_INT
,
276 'title' => ts('Soft Credit Type') ,
277 'description' => 'Soft Credit Type ID.Implicit FK to civicrm_option_value where option_group = soft_credit_type.',
279 'pseudoconstant' => array(
280 'optionGroupName' => 'soft_credit_type',
281 'optionEditPath' => 'civicrm/admin/options/soft_credit_type',
286 return self
::$_fields;
289 * Returns an array containing, for each field, the arary key used for that
290 * field in self::$_fields.
294 static function &fieldKeys() {
295 if (!(self
::$_fieldKeys)) {
296 self
::$_fieldKeys = array(
297 'id' => 'contribution_soft_id',
298 'contribution_id' => 'contribution_id',
299 'contact_id' => 'contribution_soft_contact_id',
300 'amount' => 'amount',
301 'currency' => 'currency',
302 'pcp_id' => 'pcp_id',
303 'pcp_display_in_roll' => 'pcp_display_in_roll',
304 'pcp_roll_nickname' => 'pcp_roll_nickname',
305 'pcp_personal_note' => 'pcp_personal_note',
306 'soft_credit_type_id' => 'soft_credit_type_id',
309 return self
::$_fieldKeys;
312 * Returns the names of this table
316 static function getTableName() {
317 return self
::$_tableName;
320 * Returns if this table needs to be logged
328 * Returns the list of fields that can be imported
330 * @param bool $prefix
334 static function &import($prefix = false) {
335 if (!(self
::$_import)) {
336 self
::$_import = array();
337 $fields = self
::fields();
338 foreach($fields as $name => $field) {
339 if (CRM_Utils_Array
::value('import', $field)) {
341 self
::$_import['contribution_soft'] = & $fields[$name];
343 self
::$_import[$name] = & $fields[$name];
348 return self
::$_import;
351 * Returns the list of fields that can be exported
353 * @param bool $prefix
357 static function &export($prefix = false) {
358 if (!(self
::$_export)) {
359 self
::$_export = array();
360 $fields = self
::fields();
361 foreach($fields as $name => $field) {
362 if (CRM_Utils_Array
::value('export', $field)) {
364 self
::$_export['contribution_soft'] = & $fields[$name];
366 self
::$_export[$name] = & $fields[$name];
371 return self
::$_export;