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 value to see if we should log any modifications to
46 * this table in the civicrm_log table
52 * Soft Contribution ID
58 * FK to contribution table.
62 public $contribution_id;
70 * Amount of this soft contribution.
76 * 3 character string, value from config setting or input via user.
82 * FK to civicrm_pcp.id
91 public $pcp_display_in_roll;
96 public $pcp_roll_nickname;
101 public $pcp_personal_note;
103 * Soft Credit Type ID.Implicit FK to civicrm_option_value where option_group = soft_credit_type.
107 public $soft_credit_type_id;
111 * @return civicrm_contribution_soft
113 function __construct() {
114 $this->__table
= 'civicrm_contribution_soft';
115 parent
::__construct();
118 * Returns foreign keys and entity references
121 * [CRM_Core_Reference_Interface]
123 static function getReferenceColumns() {
124 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
125 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
126 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contribution_id', 'civicrm_contribution', 'id');
127 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contact_id', 'civicrm_contact', 'id');
128 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'pcp_id', 'civicrm_pcp', '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 'contribution_soft_id' => array(
143 'type' => CRM_Utils_Type
::T_INT
,
144 'title' => ts('Soft Contribution ID') ,
145 'description' => 'Soft Contribution ID',
148 'where' => 'civicrm_contribution_soft.id',
149 'headerPattern' => '',
153 'contribution_id' => array(
154 'name' => 'contribution_id',
155 'type' => CRM_Utils_Type
::T_INT
,
156 'title' => ts('Soft Contribution - Contribution') ,
157 'description' => 'FK to contribution table.',
159 'FKClassName' => 'CRM_Contribute_DAO_Contribution',
161 'contribution_soft_contact_id' => array(
162 'name' => 'contact_id',
163 'type' => CRM_Utils_Type
::T_INT
,
164 'title' => ts('Contact ID') ,
165 'description' => 'FK to Contact ID',
168 'where' => 'civicrm_contribution_soft.contact_id',
169 'headerPattern' => '/contact(.?id)?/i',
170 'dataPattern' => '/^\d+$/',
172 'FKClassName' => 'CRM_Contact_DAO_Contact',
176 'type' => CRM_Utils_Type
::T_MONEY
,
177 'title' => ts('Soft Contribution Amount') ,
178 'description' => 'Amount of this soft contribution.',
180 'precision' => array(
185 'where' => 'civicrm_contribution_soft.amount',
186 'headerPattern' => '/total(.?am(ou)?nt)?/i',
187 'dataPattern' => '/^\d+(\.\d{2})?$/',
191 'name' => 'currency',
192 'type' => CRM_Utils_Type
::T_STRING
,
193 'title' => ts('Soft Contribution Currency') ,
194 'description' => '3 character string, value from config setting or input via user.',
196 'size' => CRM_Utils_Type
::FOUR
,
201 'pseudoconstant' => array(
202 'table' => 'civicrm_currency',
203 'keyColumn' => 'name',
204 'labelColumn' => 'full_name',
205 'nameColumn' => 'name',
210 'type' => CRM_Utils_Type
::T_INT
,
211 'title' => ts('Soft Contribution PCP') ,
212 'description' => 'FK to civicrm_pcp.id',
214 'FKClassName' => 'CRM_PCP_DAO_PCP',
215 'pseudoconstant' => array(
216 'table' => 'civicrm_pcp',
218 'labelColumn' => 'title',
221 'pcp_display_in_roll' => array(
222 'name' => 'pcp_display_in_roll',
223 'type' => CRM_Utils_Type
::T_BOOLEAN
,
224 'title' => ts('Soft Contribution Display on PCP') ,
226 'pcp_roll_nickname' => array(
227 'name' => 'pcp_roll_nickname',
228 'type' => CRM_Utils_Type
::T_STRING
,
229 'title' => ts('Soft Contribution PCP Nickname') ,
231 'size' => CRM_Utils_Type
::HUGE
,
234 'pcp_personal_note' => array(
235 'name' => 'pcp_personal_note',
236 'type' => CRM_Utils_Type
::T_STRING
,
237 'title' => ts('Soft Contribution PCP Note') ,
239 'size' => CRM_Utils_Type
::HUGE
,
242 'soft_credit_type_id' => array(
243 'name' => 'soft_credit_type_id',
244 'type' => CRM_Utils_Type
::T_INT
,
245 'title' => ts('Soft Credit Type') ,
246 'description' => 'Soft Credit Type ID.Implicit FK to civicrm_option_value where option_group = soft_credit_type.',
248 'pseudoconstant' => array(
249 'optionGroupName' => 'soft_credit_type',
250 'optionEditPath' => 'civicrm/admin/options/soft_credit_type',
254 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
256 return Civi
::$statics[__CLASS__
]['fields'];
259 * Return a mapping from field-name to the corresponding key (as used in fields()).
262 * Array(string $name => string $uniqueName).
264 static function &fieldKeys() {
265 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
266 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
268 return Civi
::$statics[__CLASS__
]['fieldKeys'];
271 * Returns the names of this table
275 static function getTableName() {
276 return self
::$_tableName;
279 * Returns if this table needs to be logged
287 * Returns the list of fields that can be imported
289 * @param bool $prefix
293 static function &import($prefix = false) {
294 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution_soft', $prefix, array());
298 * Returns the list of fields that can be exported
300 * @param bool $prefix
304 static function &export($prefix = false) {
305 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution_soft', $prefix, array());