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:c03f89f9fba7d8b9c3b863393e617a78)
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',
149 'contribution_id' => [
150 'name' => 'contribution_id',
151 'type' => CRM_Utils_Type
::T_INT
,
152 'title' => ts('Soft Contribution - Contribution'),
153 'description' => ts('FK to contribution table.'),
155 'where' => 'civicrm_contribution_soft.contribution_id',
156 'table_name' => 'civicrm_contribution_soft',
157 'entity' => 'ContributionSoft',
158 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
160 'FKClassName' => 'CRM_Contribute_DAO_Contribution',
162 'contribution_soft_contact_id' => [
163 'name' => 'contact_id',
164 'type' => CRM_Utils_Type
::T_INT
,
165 'title' => ts('Contact ID'),
166 'description' => ts('FK to Contact ID'),
169 'where' => 'civicrm_contribution_soft.contact_id',
170 'headerPattern' => '/contact(.?id)?/i',
171 'dataPattern' => '/^\d+$/',
173 'table_name' => 'civicrm_contribution_soft',
174 'entity' => 'ContributionSoft',
175 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
177 'FKClassName' => 'CRM_Contact_DAO_Contact',
181 'type' => CRM_Utils_Type
::T_MONEY
,
182 'title' => ts('Soft Contribution Amount'),
183 'description' => ts('Amount of this soft contribution.'),
190 'where' => 'civicrm_contribution_soft.amount',
191 'headerPattern' => '/total(.?am(ou)?nt)?/i',
192 'dataPattern' => '/^\d+(\.\d{2})?$/',
194 'table_name' => 'civicrm_contribution_soft',
195 'entity' => 'ContributionSoft',
196 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
200 'name' => 'currency',
201 'type' => CRM_Utils_Type
::T_STRING
,
202 'title' => ts('Soft Contribution Currency'),
203 'description' => ts('3 character string, value from config setting or input via user.'),
205 'size' => CRM_Utils_Type
::FOUR
,
206 'where' => 'civicrm_contribution_soft.currency',
208 'table_name' => 'civicrm_contribution_soft',
209 'entity' => 'ContributionSoft',
210 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
215 'pseudoconstant' => [
216 'table' => 'civicrm_currency',
217 'keyColumn' => 'name',
218 'labelColumn' => 'full_name',
219 'nameColumn' => 'name',
220 'abbrColumn' => 'symbol',
225 'type' => CRM_Utils_Type
::T_INT
,
226 'title' => ts('Soft Contribution PCP'),
227 'description' => ts('FK to civicrm_pcp.id'),
228 'where' => 'civicrm_contribution_soft.pcp_id',
230 'table_name' => 'civicrm_contribution_soft',
231 'entity' => 'ContributionSoft',
232 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
234 'FKClassName' => 'CRM_PCP_DAO_PCP',
235 'pseudoconstant' => [
236 'table' => 'civicrm_pcp',
238 'labelColumn' => 'title',
241 'pcp_display_in_roll' => [
242 'name' => 'pcp_display_in_roll',
243 'type' => CRM_Utils_Type
::T_BOOLEAN
,
244 'title' => ts('Soft Contribution Display on PCP'),
245 'where' => 'civicrm_contribution_soft.pcp_display_in_roll',
247 'table_name' => 'civicrm_contribution_soft',
248 'entity' => 'ContributionSoft',
249 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
252 'pcp_roll_nickname' => [
253 'name' => 'pcp_roll_nickname',
254 'type' => CRM_Utils_Type
::T_STRING
,
255 'title' => ts('Soft Contribution PCP Nickname'),
257 'size' => CRM_Utils_Type
::HUGE
,
258 'where' => 'civicrm_contribution_soft.pcp_roll_nickname',
260 'table_name' => 'civicrm_contribution_soft',
261 'entity' => 'ContributionSoft',
262 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
265 'pcp_personal_note' => [
266 'name' => 'pcp_personal_note',
267 'type' => CRM_Utils_Type
::T_STRING
,
268 'title' => ts('Soft Contribution PCP Note'),
270 'size' => CRM_Utils_Type
::HUGE
,
271 'where' => 'civicrm_contribution_soft.pcp_personal_note',
273 'table_name' => 'civicrm_contribution_soft',
274 'entity' => 'ContributionSoft',
275 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
278 'type' => 'TextArea',
281 'soft_credit_type_id' => [
282 'name' => 'soft_credit_type_id',
283 'type' => CRM_Utils_Type
::T_INT
,
284 'title' => ts('Soft Credit Type'),
285 'description' => ts('Soft Credit Type ID.Implicit FK to civicrm_option_value where option_group = soft_credit_type.'),
286 'where' => 'civicrm_contribution_soft.soft_credit_type_id',
288 'table_name' => 'civicrm_contribution_soft',
289 'entity' => 'ContributionSoft',
290 'bao' => 'CRM_Contribute_BAO_ContributionSoft',
292 'pseudoconstant' => [
293 'optionGroupName' => 'soft_credit_type',
294 'optionEditPath' => 'civicrm/admin/options/soft_credit_type',
298 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
300 return Civi
::$statics[__CLASS__
]['fields'];
304 * Return a mapping from field-name to the corresponding key (as used in fields()).
307 * Array(string $name => string $uniqueName).
309 public static function &fieldKeys() {
310 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
311 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
313 return Civi
::$statics[__CLASS__
]['fieldKeys'];
317 * Returns the names of this table
321 public static function getTableName() {
322 return self
::$_tableName;
326 * Returns if this table needs to be logged
330 public function getLog() {
335 * Returns the list of fields that can be imported
337 * @param bool $prefix
341 public static function &import($prefix = FALSE) {
342 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution_soft', $prefix, []);
347 * Returns the list of fields that can be exported
349 * @param bool $prefix
353 public static function &export($prefix = FALSE) {
354 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution_soft', $prefix, []);
359 * Returns the list of indices
361 * @param bool $localize
365 public static function indices($localize = TRUE) {
368 'name' => 'index_id',
372 'localizable' => FALSE,
373 'sig' => 'civicrm_contribution_soft::0::pcp_id',
376 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;