5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Contribute/ContributionSoft.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:b9a4bdee130cdaf934a53e456cd0e3e8)
13 * Database access object for the ContributionSoft entity.
15 class CRM_Contribute_DAO_ContributionSoft
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_contribution_soft';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
32 * Soft Contribution ID
39 * FK to contribution table.
43 public $contribution_id;
53 * Amount of this soft contribution.
60 * 3 character string, value from config setting or input via user.
67 * FK to civicrm_pcp.id
76 public $pcp_display_in_roll;
81 public $pcp_roll_nickname;
86 public $pcp_personal_note;
89 * Soft Credit Type ID.Implicit FK to civicrm_option_value where option_group = soft_credit_type.
93 public $soft_credit_type_id;
98 public function __construct() {
99 $this->__table
= 'civicrm_contribution_soft';
100 parent
::__construct();
104 * Returns foreign keys and entity references.
107 * [CRM_Core_Reference_Interface]
109 public static function getReferenceColumns() {
110 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
111 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
112 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contribution_id', 'civicrm_contribution', 'id');
113 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
114 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'pcp_id', 'civicrm_pcp', 'id');
115 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
117 return Civi
::$statics[__CLASS__
]['links'];
121 * Returns all the column names of this table
125 public static function &fields() {
126 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
127 Civi
::$statics[__CLASS__
]['fields'] = [
128 'contribution_soft_id' => [
130 'type' => CRM_Utils_Type
::T_INT
,
131 'title' => ts('Soft Contribution ID'),
132 'description' => ts('Soft Contribution ID'),
135 'where' => 'civicrm_contribution_soft.id',
136 'headerPattern' => '',
139 'table_name' => 'civicrm_contribution_soft',
140 'entity' => 'ContributionSoft',
141 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
144 'contribution_id' => [
145 'name' => 'contribution_id',
146 'type' => CRM_Utils_Type
::T_INT
,
147 'title' => ts('Soft Contribution - Contribution'),
148 'description' => ts('FK to contribution table.'),
150 'table_name' => 'civicrm_contribution_soft',
151 'entity' => 'ContributionSoft',
152 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
154 'FKClassName' => 'CRM_Contribute_DAO_Contribution',
156 'contribution_soft_contact_id' => [
157 'name' => 'contact_id',
158 'type' => CRM_Utils_Type
::T_INT
,
159 'title' => ts('Contact ID'),
160 'description' => ts('FK to Contact ID'),
163 'where' => 'civicrm_contribution_soft.contact_id',
164 'headerPattern' => '/contact(.?id)?/i',
165 'dataPattern' => '/^\d+$/',
167 'table_name' => 'civicrm_contribution_soft',
168 'entity' => 'ContributionSoft',
169 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
171 'FKClassName' => 'CRM_Contact_DAO_Contact',
175 'type' => CRM_Utils_Type
::T_MONEY
,
176 'title' => ts('Soft Contribution Amount'),
177 'description' => ts('Amount of this soft contribution.'),
184 'where' => 'civicrm_contribution_soft.amount',
185 'headerPattern' => '/total(.?am(ou)?nt)?/i',
186 'dataPattern' => '/^\d+(\.\d{2})?$/',
188 'table_name' => 'civicrm_contribution_soft',
189 'entity' => 'ContributionSoft',
190 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
194 'name' => 'currency',
195 'type' => CRM_Utils_Type
::T_STRING
,
196 'title' => ts('Soft Contribution Currency'),
197 'description' => ts('3 character string, value from config setting or input via user.'),
199 'size' => CRM_Utils_Type
::FOUR
,
201 'table_name' => 'civicrm_contribution_soft',
202 'entity' => 'ContributionSoft',
203 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
208 'pseudoconstant' => [
209 'table' => 'civicrm_currency',
210 'keyColumn' => 'name',
211 'labelColumn' => 'full_name',
212 'nameColumn' => 'name',
217 'type' => CRM_Utils_Type
::T_INT
,
218 'title' => ts('Soft Contribution PCP'),
219 'description' => ts('FK to civicrm_pcp.id'),
221 'table_name' => 'civicrm_contribution_soft',
222 'entity' => 'ContributionSoft',
223 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
225 'FKClassName' => 'CRM_PCP_DAO_PCP',
226 'pseudoconstant' => [
227 'table' => 'civicrm_pcp',
229 'labelColumn' => 'title',
232 'pcp_display_in_roll' => [
233 'name' => 'pcp_display_in_roll',
234 'type' => CRM_Utils_Type
::T_BOOLEAN
,
235 'title' => ts('Soft Contribution Display on PCP'),
237 'table_name' => 'civicrm_contribution_soft',
238 'entity' => 'ContributionSoft',
239 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
242 'pcp_roll_nickname' => [
243 'name' => 'pcp_roll_nickname',
244 'type' => CRM_Utils_Type
::T_STRING
,
245 'title' => ts('Soft Contribution PCP Nickname'),
247 'size' => CRM_Utils_Type
::HUGE
,
249 'table_name' => 'civicrm_contribution_soft',
250 'entity' => 'ContributionSoft',
251 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
254 'pcp_personal_note' => [
255 'name' => 'pcp_personal_note',
256 'type' => CRM_Utils_Type
::T_STRING
,
257 'title' => ts('Soft Contribution PCP Note'),
259 'size' => CRM_Utils_Type
::HUGE
,
261 'table_name' => 'civicrm_contribution_soft',
262 'entity' => 'ContributionSoft',
263 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
266 'type' => 'TextArea',
269 'soft_credit_type_id' => [
270 'name' => 'soft_credit_type_id',
271 'type' => CRM_Utils_Type
::T_INT
,
272 'title' => ts('Soft Credit Type'),
273 'description' => ts('Soft Credit Type ID.Implicit FK to civicrm_option_value where option_group = soft_credit_type.'),
275 'table_name' => 'civicrm_contribution_soft',
276 'entity' => 'ContributionSoft',
277 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
279 'pseudoconstant' => [
280 'optionGroupName' => 'soft_credit_type',
281 'optionEditPath' => 'civicrm/admin/options/soft_credit_type',
285 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
287 return Civi
::$statics[__CLASS__
]['fields'];
291 * Return a mapping from field-name to the corresponding key (as used in fields()).
294 * Array(string $name => string $uniqueName).
296 public static function &fieldKeys() {
297 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
298 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
300 return Civi
::$statics[__CLASS__
]['fieldKeys'];
304 * Returns the names of this table
308 public static function getTableName() {
309 return self
::$_tableName;
313 * Returns if this table needs to be logged
317 public function getLog() {
322 * Returns the list of fields that can be imported
324 * @param bool $prefix
328 public static function &import($prefix = FALSE) {
329 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution_soft', $prefix, []);
334 * Returns the list of fields that can be exported
336 * @param bool $prefix
340 public static function &export($prefix = FALSE) {
341 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution_soft', $prefix, []);
346 * Returns the list of indices
348 * @param bool $localize
352 public static function indices($localize = TRUE) {
355 'name' => 'index_id',
359 'localizable' => FALSE,
360 'sig' => 'civicrm_contribution_soft::0::pcp_id',
363 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;