5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Contribute/ContributionSoft.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:e183ac4d1412bc227a1be7975cc67b0a)
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 static $_tableName = 'civicrm_contribution_soft';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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' => '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' => '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' => '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' => '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' => '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' => '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'),
236 'table_name' => 'civicrm_contribution_soft',
237 'entity' => 'ContributionSoft',
238 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
241 'pcp_roll_nickname' => [
242 'name' => 'pcp_roll_nickname',
243 'type' => CRM_Utils_Type
::T_STRING
,
244 'title' => ts('Soft Contribution PCP Nickname'),
246 'size' => CRM_Utils_Type
::HUGE
,
248 'table_name' => 'civicrm_contribution_soft',
249 'entity' => 'ContributionSoft',
250 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
253 'pcp_personal_note' => [
254 'name' => 'pcp_personal_note',
255 'type' => CRM_Utils_Type
::T_STRING
,
256 'title' => ts('Soft Contribution PCP Note'),
258 'size' => CRM_Utils_Type
::HUGE
,
260 'table_name' => 'civicrm_contribution_soft',
261 'entity' => 'ContributionSoft',
262 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
265 'type' => 'TextArea',
268 'soft_credit_type_id' => [
269 'name' => 'soft_credit_type_id',
270 'type' => CRM_Utils_Type
::T_INT
,
271 'title' => ts('Soft Credit Type'),
272 'description' => 'Soft Credit Type ID.Implicit FK to civicrm_option_value where option_group = soft_credit_type.',
274 'table_name' => 'civicrm_contribution_soft',
275 'entity' => 'ContributionSoft',
276 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
278 'pseudoconstant' => [
279 'optionGroupName' => 'soft_credit_type',
280 'optionEditPath' => 'civicrm/admin/options/soft_credit_type',
284 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
286 return Civi
::$statics[__CLASS__
]['fields'];
290 * Return a mapping from field-name to the corresponding key (as used in fields()).
293 * Array(string $name => string $uniqueName).
295 public static function &fieldKeys() {
296 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
297 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
299 return Civi
::$statics[__CLASS__
]['fieldKeys'];
303 * Returns the names of this table
307 public static function getTableName() {
308 return self
::$_tableName;
312 * Returns if this table needs to be logged
316 public function getLog() {
321 * Returns the list of fields that can be imported
323 * @param bool $prefix
327 public static function &import($prefix = FALSE) {
328 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution_soft', $prefix, []);
333 * Returns the list of fields that can be exported
335 * @param bool $prefix
339 public static function &export($prefix = FALSE) {
340 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution_soft', $prefix, []);
345 * Returns the list of indices
347 * @param bool $localize
351 public static function indices($localize = TRUE) {
354 'name' => 'index_id',
358 'localizable' => FALSE,
359 'sig' => 'civicrm_contribution_soft::0::pcp_id',
362 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;