5 * @copyright CiviCRM LLC (c) 2004-2017
7 * Generated from xml/schema/CRM/Financial/EntityFinancialTrxn.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:8650c2685e9d125bed6f9b65ce208621)
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 static $_tableName = 'civicrm_entity_financial_trxn';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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' => 'ID',
100 'table_name' => 'civicrm_entity_financial_trxn',
101 'entity' => 'EntityFinancialTrxn',
102 'bao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
106 'name' => 'entity_table',
107 'type' => CRM_Utils_Type
::T_STRING
,
108 'title' => ts('Entity Table'),
109 'description' => 'May contain civicrm_financial_item, civicrm_contribution, civicrm_financial_trxn, civicrm_grant, etc',
112 'size' => CRM_Utils_Type
::BIG
,
114 'where' => 'civicrm_entity_financial_trxn.entity_table',
115 'headerPattern' => '',
118 'table_name' => 'civicrm_entity_financial_trxn',
119 'entity' => 'EntityFinancialTrxn',
120 'bao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
124 'name' => 'entity_id',
125 'type' => CRM_Utils_Type
::T_INT
,
126 'title' => ts('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 'table_name' => 'civicrm_entity_financial_trxn',
138 'entity' => 'EntityFinancialTrxn',
139 'bao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
141 'FKClassName' => 'CRM_Financial_DAO_FinancialTrxn',
145 'type' => CRM_Utils_Type
::T_MONEY
,
146 'title' => ts('Amount'),
147 'description' => 'allocated amount of transaction to this entity',
154 'where' => 'civicrm_entity_financial_trxn.amount',
155 'headerPattern' => '/amount/i',
156 'dataPattern' => '/^\d+(\.\d{2})?$/',
158 'table_name' => 'civicrm_entity_financial_trxn',
159 'entity' => 'EntityFinancialTrxn',
160 'bao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
164 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
166 return Civi
::$statics[__CLASS__
]['fields'];
170 * Return a mapping from field-name to the corresponding key (as used in fields()).
173 * Array(string $name => string $uniqueName).
175 public static function &fieldKeys() {
176 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
177 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
179 return Civi
::$statics[__CLASS__
]['fieldKeys'];
183 * Returns the names of this table
187 public static function getTableName() {
188 return self
::$_tableName;
192 * Returns if this table needs to be logged
196 public function getLog() {
201 * Returns the list of fields that can be imported
203 * @param bool $prefix
207 public static function &import($prefix = FALSE) {
208 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'entity_financial_trxn', $prefix, []);
213 * Returns the list of fields that can be exported
215 * @param bool $prefix
219 public static function &export($prefix = FALSE) {
220 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'entity_financial_trxn', $prefix, []);
225 * Returns the list of indices
227 * @param bool $localize
231 public static function indices($localize = TRUE) {
233 'UI_entity_financial_trxn_entity_table' => [
234 'name' => 'UI_entity_financial_trxn_entity_table',
238 'localizable' => FALSE,
239 'sig' => 'civicrm_entity_financial_trxn::0::entity_table',
241 'UI_entity_financial_trxn_entity_id' => [
242 'name' => 'UI_entity_financial_trxn_entity_id',
246 'localizable' => FALSE,
247 'sig' => 'civicrm_entity_financial_trxn::0::entity_id',
250 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;