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:2872ea7ea6a2581d868e805574b9ae9f)
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',
137 'table_name' => 'civicrm_contribution_soft',
138 'entity' => 'ContributionSoft',
139 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
142 'contribution_id' => [
143 'name' => 'contribution_id',
144 'type' => CRM_Utils_Type
::T_INT
,
145 'title' => ts('Soft Contribution - Contribution'),
146 'description' => ts('FK to contribution table.'),
148 'where' => 'civicrm_contribution_soft.contribution_id',
149 'table_name' => 'civicrm_contribution_soft',
150 'entity' => 'ContributionSoft',
151 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
153 'FKClassName' => 'CRM_Contribute_DAO_Contribution',
155 'contribution_soft_contact_id' => [
156 'name' => 'contact_id',
157 'type' => CRM_Utils_Type
::T_INT
,
158 'title' => ts('Contact ID'),
159 'description' => ts('FK to Contact ID'),
162 'where' => 'civicrm_contribution_soft.contact_id',
163 'headerPattern' => '/contact(.?id)?/i',
164 'dataPattern' => '/^\d+$/',
166 'table_name' => 'civicrm_contribution_soft',
167 'entity' => 'ContributionSoft',
168 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
170 'FKClassName' => 'CRM_Contact_DAO_Contact',
174 'type' => CRM_Utils_Type
::T_MONEY
,
175 'title' => ts('Soft Contribution Amount'),
176 'description' => ts('Amount of this soft contribution.'),
183 'where' => 'civicrm_contribution_soft.amount',
184 'headerPattern' => '/total(.?am(ou)?nt)?/i',
185 'dataPattern' => '/^\d+(\.\d{2})?$/',
187 'table_name' => 'civicrm_contribution_soft',
188 'entity' => 'ContributionSoft',
189 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
193 'name' => 'currency',
194 'type' => CRM_Utils_Type
::T_STRING
,
195 'title' => ts('Soft Contribution Currency'),
196 'description' => ts('3 character string, value from config setting or input via user.'),
198 'size' => CRM_Utils_Type
::FOUR
,
199 'where' => 'civicrm_contribution_soft.currency',
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'),
220 'where' => 'civicrm_contribution_soft.pcp_id',
222 'table_name' => 'civicrm_contribution_soft',
223 'entity' => 'ContributionSoft',
224 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
226 'FKClassName' => 'CRM_PCP_DAO_PCP',
227 'pseudoconstant' => [
228 'table' => 'civicrm_pcp',
230 'labelColumn' => 'title',
233 'pcp_display_in_roll' => [
234 'name' => 'pcp_display_in_roll',
235 'type' => CRM_Utils_Type
::T_BOOLEAN
,
236 'title' => ts('Soft Contribution Display on PCP'),
237 'where' => 'civicrm_contribution_soft.pcp_display_in_roll',
239 'table_name' => 'civicrm_contribution_soft',
240 'entity' => 'ContributionSoft',
241 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
244 'pcp_roll_nickname' => [
245 'name' => 'pcp_roll_nickname',
246 'type' => CRM_Utils_Type
::T_STRING
,
247 'title' => ts('Soft Contribution PCP Nickname'),
249 'size' => CRM_Utils_Type
::HUGE
,
250 'where' => 'civicrm_contribution_soft.pcp_roll_nickname',
252 'table_name' => 'civicrm_contribution_soft',
253 'entity' => 'ContributionSoft',
254 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
257 'pcp_personal_note' => [
258 'name' => 'pcp_personal_note',
259 'type' => CRM_Utils_Type
::T_STRING
,
260 'title' => ts('Soft Contribution PCP Note'),
262 'size' => CRM_Utils_Type
::HUGE
,
263 'where' => 'civicrm_contribution_soft.pcp_personal_note',
265 'table_name' => 'civicrm_contribution_soft',
266 'entity' => 'ContributionSoft',
267 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
270 'type' => 'TextArea',
273 'soft_credit_type_id' => [
274 'name' => 'soft_credit_type_id',
275 'type' => CRM_Utils_Type
::T_INT
,
276 'title' => ts('Soft Credit Type'),
277 'description' => ts('Soft Credit Type ID.Implicit FK to civicrm_option_value where option_group = soft_credit_type.'),
278 'where' => 'civicrm_contribution_soft.soft_credit_type_id',
280 'table_name' => 'civicrm_contribution_soft',
281 'entity' => 'ContributionSoft',
282 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
284 'pseudoconstant' => [
285 'optionGroupName' => 'soft_credit_type',
286 'optionEditPath' => 'civicrm/admin/options/soft_credit_type',
290 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
292 return Civi
::$statics[__CLASS__
]['fields'];
296 * Return a mapping from field-name to the corresponding key (as used in fields()).
299 * Array(string $name => string $uniqueName).
301 public static function &fieldKeys() {
302 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
303 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
305 return Civi
::$statics[__CLASS__
]['fieldKeys'];
309 * Returns the names of this table
313 public static function getTableName() {
314 return self
::$_tableName;
318 * Returns if this table needs to be logged
322 public function getLog() {
327 * Returns the list of fields that can be imported
329 * @param bool $prefix
333 public static function &import($prefix = FALSE) {
334 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution_soft', $prefix, []);
339 * Returns the list of fields that can be exported
341 * @param bool $prefix
345 public static function &export($prefix = FALSE) {
346 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution_soft', $prefix, []);
351 * Returns the list of indices
353 * @param bool $localize
357 public static function indices($localize = TRUE) {
360 'name' => 'index_id',
364 'localizable' => FALSE,
365 'sig' => 'civicrm_contribution_soft::0::pcp_id',
368 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;