5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Financial/EntityFinancialTrxn.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:a2a7ed7efce5731cde1127d2ca874fb6)
13 * Database access object for the EntityFinancialTrxn entity.
15 class CRM_Financial_DAO_EntityFinancialTrxn
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_entity_financial_trxn';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * May contain civicrm_financial_item, civicrm_contribution, civicrm_financial_trxn, civicrm_grant, etc
53 public $financial_trxn_id;
56 * allocated amount of transaction to this entity
65 public function __construct() {
66 $this->__table
= 'civicrm_entity_financial_trxn';
67 parent
::__construct();
71 * Returns foreign keys and entity references.
74 * [CRM_Core_Reference_Interface]
76 public static function getReferenceColumns() {
77 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
78 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
79 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'financial_trxn_id', 'civicrm_financial_trxn', 'id');
80 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
81 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
83 return Civi
::$statics[__CLASS__
]['links'];
87 * Returns all the column names of this table
91 public static function &fields() {
92 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
93 Civi
::$statics[__CLASS__
]['fields'] = [
96 'type' => CRM_Utils_Type
::T_INT
,
97 'title' => ts('Entity Financial Transaction ID'),
98 'description' => ts('ID'),
100 'where' => 'civicrm_entity_financial_trxn.id',
101 'table_name' => 'civicrm_entity_financial_trxn',
102 'entity' => 'EntityFinancialTrxn',
103 'bao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
107 'name' => 'entity_table',
108 'type' => CRM_Utils_Type
::T_STRING
,
109 'title' => ts('Entity Table'),
110 'description' => ts('May contain civicrm_financial_item, civicrm_contribution, civicrm_financial_trxn, civicrm_grant, etc'),
113 'size' => CRM_Utils_Type
::BIG
,
115 'where' => 'civicrm_entity_financial_trxn.entity_table',
117 'table_name' => 'civicrm_entity_financial_trxn',
118 'entity' => 'EntityFinancialTrxn',
119 'bao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
123 'name' => 'entity_id',
124 'type' => CRM_Utils_Type
::T_INT
,
125 'title' => ts('Entity ID'),
127 'where' => 'civicrm_entity_financial_trxn.entity_id',
128 'table_name' => 'civicrm_entity_financial_trxn',
129 'entity' => 'EntityFinancialTrxn',
130 'bao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
133 'financial_trxn_id' => [
134 'name' => 'financial_trxn_id',
135 'type' => CRM_Utils_Type
::T_INT
,
136 'title' => ts('Financial Transaction Id'),
137 'where' => 'civicrm_entity_financial_trxn.financial_trxn_id',
138 'table_name' => 'civicrm_entity_financial_trxn',
139 'entity' => 'EntityFinancialTrxn',
140 'bao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
142 'FKClassName' => 'CRM_Financial_DAO_FinancialTrxn',
146 'type' => CRM_Utils_Type
::T_MONEY
,
147 'title' => ts('Amount'),
148 'description' => ts('allocated amount of transaction to this entity'),
155 'where' => 'civicrm_entity_financial_trxn.amount',
156 'headerPattern' => '/amount/i',
157 'dataPattern' => '/^\d+(\.\d{2})?$/',
159 'table_name' => 'civicrm_entity_financial_trxn',
160 'entity' => 'EntityFinancialTrxn',
161 'bao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
165 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
167 return Civi
::$statics[__CLASS__
]['fields'];
171 * Return a mapping from field-name to the corresponding key (as used in fields()).
174 * Array(string $name => string $uniqueName).
176 public static function &fieldKeys() {
177 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
178 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
180 return Civi
::$statics[__CLASS__
]['fieldKeys'];
184 * Returns the names of this table
188 public static function getTableName() {
189 return self
::$_tableName;
193 * Returns if this table needs to be logged
197 public function getLog() {
202 * Returns the list of fields that can be imported
204 * @param bool $prefix
208 public static function &import($prefix = FALSE) {
209 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'entity_financial_trxn', $prefix, []);
214 * Returns the list of fields that can be exported
216 * @param bool $prefix
220 public static function &export($prefix = FALSE) {
221 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'entity_financial_trxn', $prefix, []);
226 * Returns the list of indices
228 * @param bool $localize
232 public static function indices($localize = TRUE) {
234 'UI_entity_financial_trxn_entity_table' => [
235 'name' => 'UI_entity_financial_trxn_entity_table',
239 'localizable' => FALSE,
240 'sig' => 'civicrm_entity_financial_trxn::0::entity_table',
242 'UI_entity_financial_trxn_entity_id' => [
243 'name' => 'UI_entity_financial_trxn_entity_id',
247 'localizable' => FALSE,
248 'sig' => 'civicrm_entity_financial_trxn::0::entity_id',
251 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;