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:2654d7bdf6a8a80e13d17a6bb88e2a1a)
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 localized title of this entity.
73 public static function getEntityTitle() {
74 return ts('Entity Financial Trxns');
78 * Returns foreign keys and entity references.
81 * [CRM_Core_Reference_Interface]
83 public static function getReferenceColumns() {
84 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
85 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
86 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'financial_trxn_id', 'civicrm_financial_trxn', 'id');
87 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
88 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
90 return Civi
::$statics[__CLASS__
]['links'];
94 * Returns all the column names of this table
98 public static function &fields() {
99 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
100 Civi
::$statics[__CLASS__
]['fields'] = [
103 'type' => CRM_Utils_Type
::T_INT
,
104 'title' => ts('Entity Financial Transaction ID'),
105 'description' => ts('ID'),
107 'where' => 'civicrm_entity_financial_trxn.id',
108 'table_name' => 'civicrm_entity_financial_trxn',
109 'entity' => 'EntityFinancialTrxn',
110 'bao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
114 'name' => 'entity_table',
115 'type' => CRM_Utils_Type
::T_STRING
,
116 'title' => ts('Entity Table'),
117 'description' => ts('May contain civicrm_financial_item, civicrm_contribution, civicrm_financial_trxn, civicrm_grant, etc'),
120 'size' => CRM_Utils_Type
::BIG
,
122 'where' => 'civicrm_entity_financial_trxn.entity_table',
124 'table_name' => 'civicrm_entity_financial_trxn',
125 'entity' => 'EntityFinancialTrxn',
126 'bao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
130 'name' => 'entity_id',
131 'type' => CRM_Utils_Type
::T_INT
,
132 'title' => ts('Entity ID'),
134 'where' => 'civicrm_entity_financial_trxn.entity_id',
135 'table_name' => 'civicrm_entity_financial_trxn',
136 'entity' => 'EntityFinancialTrxn',
137 'bao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
140 'financial_trxn_id' => [
141 'name' => 'financial_trxn_id',
142 'type' => CRM_Utils_Type
::T_INT
,
143 'title' => ts('Financial Transaction Id'),
144 'where' => 'civicrm_entity_financial_trxn.financial_trxn_id',
145 'table_name' => 'civicrm_entity_financial_trxn',
146 'entity' => 'EntityFinancialTrxn',
147 'bao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
149 'FKClassName' => 'CRM_Financial_DAO_FinancialTrxn',
153 'type' => CRM_Utils_Type
::T_MONEY
,
154 'title' => ts('Amount'),
155 'description' => ts('allocated amount of transaction to this entity'),
162 'where' => 'civicrm_entity_financial_trxn.amount',
163 'headerPattern' => '/amount/i',
164 'dataPattern' => '/^\d+(\.\d{2})?$/',
166 'table_name' => 'civicrm_entity_financial_trxn',
167 'entity' => 'EntityFinancialTrxn',
168 'bao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
172 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
174 return Civi
::$statics[__CLASS__
]['fields'];
178 * Return a mapping from field-name to the corresponding key (as used in fields()).
181 * Array(string $name => string $uniqueName).
183 public static function &fieldKeys() {
184 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
185 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
187 return Civi
::$statics[__CLASS__
]['fieldKeys'];
191 * Returns the names of this table
195 public static function getTableName() {
196 return self
::$_tableName;
200 * Returns if this table needs to be logged
204 public function getLog() {
209 * Returns the list of fields that can be imported
211 * @param bool $prefix
215 public static function &import($prefix = FALSE) {
216 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'entity_financial_trxn', $prefix, []);
221 * Returns the list of fields that can be exported
223 * @param bool $prefix
227 public static function &export($prefix = FALSE) {
228 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'entity_financial_trxn', $prefix, []);
233 * Returns the list of indices
235 * @param bool $localize
239 public static function indices($localize = TRUE) {
241 'UI_entity_financial_trxn_entity_table' => [
242 'name' => 'UI_entity_financial_trxn_entity_table',
246 'localizable' => FALSE,
247 'sig' => 'civicrm_entity_financial_trxn::0::entity_table',
249 'UI_entity_financial_trxn_entity_id' => [
250 'name' => 'UI_entity_financial_trxn_entity_id',
254 'localizable' => FALSE,
255 'sig' => 'civicrm_entity_financial_trxn::0::entity_id',
258 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;