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 FK relationships
55 static $_links = null;
57 * static value to see if we should log any modifications to
58 * this table in the civicrm_log table
64 * Soft Contribution ID
70 * FK to contribution table.
74 public $contribution_id;
82 * Amount of this soft contribution.
88 * 3 character string, value from config setting or input via user.
94 * FK to civicrm_pcp.id
103 public $pcp_display_in_roll;
108 public $pcp_roll_nickname;
113 public $pcp_personal_note;
115 * Soft Credit Type ID.Implicit FK to civicrm_option_value where option_group = soft_credit_type.
119 public $soft_credit_type_id;
123 * @return civicrm_contribution_soft
125 function __construct() {
126 $this->__table
= 'civicrm_contribution_soft';
127 parent
::__construct();
130 * Returns foreign keys and entity references
133 * [CRM_Core_Reference_Interface]
135 static function getReferenceColumns() {
136 if (!self
::$_links) {
137 self
::$_links = static ::createReferenceColumns(__CLASS__
);
138 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contribution_id', 'civicrm_contribution', 'id');
139 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contact_id', 'civicrm_contact', 'id');
140 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'pcp_id', 'civicrm_pcp', 'id');
142 return self
::$_links;
145 * Returns all the column names of this table
149 static function &fields() {
150 if (!(self
::$_fields)) {
151 self
::$_fields = array(
152 'contribution_soft_id' => array(
154 'type' => CRM_Utils_Type
::T_INT
,
155 'title' => ts('Soft Contribution ID') ,
156 'description' => 'Soft Contribution ID',
159 'where' => 'civicrm_contribution_soft.id',
160 'headerPattern' => '',
164 'contribution_id' => array(
165 'name' => 'contribution_id',
166 'type' => CRM_Utils_Type
::T_INT
,
167 'title' => ts('Soft Contribution - Contribution') ,
168 'description' => 'FK to contribution table.',
170 'FKClassName' => 'CRM_Contribute_DAO_Contribution',
172 'contribution_soft_contact_id' => array(
173 'name' => 'contact_id',
174 'type' => CRM_Utils_Type
::T_INT
,
175 'title' => ts('Contact ID') ,
176 'description' => 'FK to Contact ID',
179 'where' => 'civicrm_contribution_soft.contact_id',
180 'headerPattern' => '/contact(.?id)?/i',
181 'dataPattern' => '/^\d+$/',
183 'FKClassName' => 'CRM_Contact_DAO_Contact',
187 'type' => CRM_Utils_Type
::T_MONEY
,
188 'title' => ts('Soft Contribution Amount') ,
189 'description' => 'Amount of this soft contribution.',
191 'precision' => array(
196 'where' => 'civicrm_contribution_soft.amount',
197 'headerPattern' => '/total(.?am(ou)?nt)?/i',
198 'dataPattern' => '/^\d+(\.\d{2})?$/',
202 'name' => 'currency',
203 'type' => CRM_Utils_Type
::T_STRING
,
204 'title' => ts('Soft Contribution Currency') ,
205 'description' => '3 character string, value from config setting or input via user.',
207 'size' => CRM_Utils_Type
::FOUR
,
212 'pseudoconstant' => array(
213 'table' => 'civicrm_currency',
214 'keyColumn' => 'name',
215 'labelColumn' => 'full_name',
216 'nameColumn' => 'name',
221 'type' => CRM_Utils_Type
::T_INT
,
222 'title' => ts('Soft Contribution PCP') ,
223 'description' => 'FK to civicrm_pcp.id',
225 'FKClassName' => 'CRM_PCP_DAO_PCP',
226 'pseudoconstant' => array(
227 'table' => 'civicrm_pcp',
229 'labelColumn' => 'title',
232 'pcp_display_in_roll' => array(
233 'name' => 'pcp_display_in_roll',
234 'type' => CRM_Utils_Type
::T_BOOLEAN
,
235 'title' => ts('Soft Contribution Display on PCP') ,
237 'pcp_roll_nickname' => array(
238 'name' => 'pcp_roll_nickname',
239 'type' => CRM_Utils_Type
::T_STRING
,
240 'title' => ts('Soft Contribution PCP Nickname') ,
242 'size' => CRM_Utils_Type
::HUGE
,
245 'pcp_personal_note' => array(
246 'name' => 'pcp_personal_note',
247 'type' => CRM_Utils_Type
::T_STRING
,
248 'title' => ts('Soft Contribution PCP Note') ,
250 'size' => CRM_Utils_Type
::HUGE
,
253 'soft_credit_type_id' => array(
254 'name' => 'soft_credit_type_id',
255 'type' => CRM_Utils_Type
::T_INT
,
256 'title' => ts('Soft Credit Type') ,
257 'description' => 'Soft Credit Type ID.Implicit FK to civicrm_option_value where option_group = soft_credit_type.',
259 'pseudoconstant' => array(
260 'optionGroupName' => 'soft_credit_type',
261 'optionEditPath' => 'civicrm/admin/options/soft_credit_type',
266 return self
::$_fields;
269 * Return a mapping from field-name to the corresponding key (as used in fields()).
272 * Array(string $name => string $uniqueName).
274 static function &fieldKeys() {
275 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
276 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
278 return Civi
::$statics[__CLASS__
]['fieldKeys'];
281 * Returns the names of this table
285 static function getTableName() {
286 return self
::$_tableName;
289 * Returns if this table needs to be logged
297 * Returns the list of fields that can be imported
299 * @param bool $prefix
303 static function &import($prefix = false) {
304 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution_soft', $prefix, array());
308 * Returns the list of fields that can be exported
310 * @param bool $prefix
314 static function &export($prefix = false) {
315 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution_soft', $prefix, array());