5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Contribute/ContributionSoft.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:a1c2918874b74f3f9bbbe0464aea1563)
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 localized title of this entity.
106 public static function getEntityTitle() {
107 return ts('Contribution Softs');
111 * Returns foreign keys and entity references.
114 * [CRM_Core_Reference_Interface]
116 public static function getReferenceColumns() {
117 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
118 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
119 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contribution_id', 'civicrm_contribution', 'id');
120 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
121 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'pcp_id', 'civicrm_pcp', 'id');
122 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
124 return Civi
::$statics[__CLASS__
]['links'];
128 * Returns all the column names of this table
132 public static function &fields() {
133 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
134 Civi
::$statics[__CLASS__
]['fields'] = [
135 'contribution_soft_id' => [
137 'type' => CRM_Utils_Type
::T_INT
,
138 'title' => ts('Soft Contribution ID'),
139 'description' => ts('Soft Contribution ID'),
142 'where' => 'civicrm_contribution_soft.id',
144 'table_name' => 'civicrm_contribution_soft',
145 'entity' => 'ContributionSoft',
146 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
150 'contribution_id' => [
151 'name' => 'contribution_id',
152 'type' => CRM_Utils_Type
::T_INT
,
153 'title' => ts('Soft Contribution - Contribution'),
154 'description' => ts('FK to contribution table.'),
156 'where' => 'civicrm_contribution_soft.contribution_id',
157 'table_name' => 'civicrm_contribution_soft',
158 'entity' => 'ContributionSoft',
159 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
161 'FKClassName' => 'CRM_Contribute_DAO_Contribution',
164 'contribution_soft_contact_id' => [
165 'name' => 'contact_id',
166 'type' => CRM_Utils_Type
::T_INT
,
167 'title' => ts('Contact ID'),
168 'description' => ts('FK to Contact ID'),
171 'where' => 'civicrm_contribution_soft.contact_id',
172 'headerPattern' => '/contact(.?id)?/i',
173 'dataPattern' => '/^\d+$/',
175 'table_name' => 'civicrm_contribution_soft',
176 'entity' => 'ContributionSoft',
177 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
179 'FKClassName' => 'CRM_Contact_DAO_Contact',
184 'type' => CRM_Utils_Type
::T_MONEY
,
185 'title' => ts('Soft Contribution Amount'),
186 'description' => ts('Amount of this soft contribution.'),
193 'where' => 'civicrm_contribution_soft.amount',
194 'headerPattern' => '/total(.?am(ou)?nt)?/i',
195 'dataPattern' => '/^\d+(\.\d{2})?$/',
197 'table_name' => 'civicrm_contribution_soft',
198 'entity' => 'ContributionSoft',
199 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
204 'name' => 'currency',
205 'type' => CRM_Utils_Type
::T_STRING
,
206 'title' => ts('Soft Contribution Currency'),
207 'description' => ts('3 character string, value from config setting or input via user.'),
209 'size' => CRM_Utils_Type
::FOUR
,
210 'where' => 'civicrm_contribution_soft.currency',
212 'table_name' => 'civicrm_contribution_soft',
213 'entity' => 'ContributionSoft',
214 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
219 'pseudoconstant' => [
220 'table' => 'civicrm_currency',
221 'keyColumn' => 'name',
222 'labelColumn' => 'full_name',
223 'nameColumn' => 'name',
224 'abbrColumn' => 'symbol',
230 'type' => CRM_Utils_Type
::T_INT
,
231 'title' => ts('Soft Contribution PCP'),
232 'description' => ts('FK to civicrm_pcp.id'),
233 'where' => 'civicrm_contribution_soft.pcp_id',
235 'table_name' => 'civicrm_contribution_soft',
236 'entity' => 'ContributionSoft',
237 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
239 'FKClassName' => 'CRM_PCP_DAO_PCP',
240 'pseudoconstant' => [
241 'table' => 'civicrm_pcp',
243 'labelColumn' => 'title',
247 'pcp_display_in_roll' => [
248 'name' => 'pcp_display_in_roll',
249 'type' => CRM_Utils_Type
::T_BOOLEAN
,
250 'title' => ts('Soft Contribution Display on PCP'),
251 'where' => 'civicrm_contribution_soft.pcp_display_in_roll',
253 'table_name' => 'civicrm_contribution_soft',
254 'entity' => 'ContributionSoft',
255 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
259 'pcp_roll_nickname' => [
260 'name' => 'pcp_roll_nickname',
261 'type' => CRM_Utils_Type
::T_STRING
,
262 'title' => ts('Soft Contribution PCP Nickname'),
264 'size' => CRM_Utils_Type
::HUGE
,
265 'where' => 'civicrm_contribution_soft.pcp_roll_nickname',
267 'table_name' => 'civicrm_contribution_soft',
268 'entity' => 'ContributionSoft',
269 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
273 'pcp_personal_note' => [
274 'name' => 'pcp_personal_note',
275 'type' => CRM_Utils_Type
::T_STRING
,
276 'title' => ts('Soft Contribution PCP Note'),
278 'size' => CRM_Utils_Type
::HUGE
,
279 'where' => 'civicrm_contribution_soft.pcp_personal_note',
281 'table_name' => 'civicrm_contribution_soft',
282 'entity' => 'ContributionSoft',
283 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
286 'type' => 'TextArea',
290 'soft_credit_type_id' => [
291 'name' => 'soft_credit_type_id',
292 'type' => CRM_Utils_Type
::T_INT
,
293 'title' => ts('Soft Credit Type'),
294 'description' => ts('Soft Credit Type ID.Implicit FK to civicrm_option_value where option_group = soft_credit_type.'),
295 'where' => 'civicrm_contribution_soft.soft_credit_type_id',
297 'table_name' => 'civicrm_contribution_soft',
298 'entity' => 'ContributionSoft',
299 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
301 'pseudoconstant' => [
302 'optionGroupName' => 'soft_credit_type',
303 'optionEditPath' => 'civicrm/admin/options/soft_credit_type',
308 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
310 return Civi
::$statics[__CLASS__
]['fields'];
314 * Return a mapping from field-name to the corresponding key (as used in fields()).
317 * Array(string $name => string $uniqueName).
319 public static function &fieldKeys() {
320 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
321 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
323 return Civi
::$statics[__CLASS__
]['fieldKeys'];
327 * Returns the names of this table
331 public static function getTableName() {
332 return self
::$_tableName;
336 * Returns if this table needs to be logged
340 public function getLog() {
345 * Returns the list of fields that can be imported
347 * @param bool $prefix
351 public static function &import($prefix = FALSE) {
352 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution_soft', $prefix, []);
357 * Returns the list of fields that can be exported
359 * @param bool $prefix
363 public static function &export($prefix = FALSE) {
364 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution_soft', $prefix, []);
369 * Returns the list of indices
371 * @param bool $localize
375 public static function indices($localize = TRUE) {
378 'name' => 'index_id',
382 'localizable' => FALSE,
383 'sig' => 'civicrm_contribution_soft::0::pcp_id',
386 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;