3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Financial/EntityFinancialTrxn.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:8650c2685e9d125bed6f9b65ce208621)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Financial_DAO_EntityFinancialTrxn constructor.
40 class CRM_Financial_DAO_EntityFinancialTrxn
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_entity_financial_trxn';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * May contain civicrm_financial_item, civicrm_contribution, civicrm_financial_trxn, civicrm_grant, etc
74 public $financial_trxn_id;
76 * allocated amount of transaction to this entity
84 function __construct() {
85 $this->__table
= 'civicrm_entity_financial_trxn';
86 parent
::__construct();
89 * Returns foreign keys and entity references.
92 * [CRM_Core_Reference_Interface]
94 static function getReferenceColumns() {
95 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
96 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
97 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'financial_trxn_id', 'civicrm_financial_trxn', 'id');
98 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
99 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
101 return Civi
::$statics[__CLASS__
]['links'];
104 * Returns all the column names of this table
108 static function &fields() {
109 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
110 Civi
::$statics[__CLASS__
]['fields'] = array(
113 'type' => CRM_Utils_Type
::T_INT
,
114 'title' => ts('Entity Financial Transaction ID') ,
115 'description' => 'ID',
117 'table_name' => 'civicrm_entity_financial_trxn',
118 'entity' => 'EntityFinancialTrxn',
119 'bao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
122 'entity_table' => array(
123 'name' => 'entity_table',
124 'type' => CRM_Utils_Type
::T_STRING
,
125 'title' => ts('Entity Table') ,
126 'description' => 'May contain civicrm_financial_item, civicrm_contribution, civicrm_financial_trxn, civicrm_grant, etc',
129 'size' => CRM_Utils_Type
::BIG
,
131 'where' => 'civicrm_entity_financial_trxn.entity_table',
132 'headerPattern' => '',
135 'table_name' => 'civicrm_entity_financial_trxn',
136 'entity' => 'EntityFinancialTrxn',
137 'bao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
140 'entity_id' => array(
141 'name' => 'entity_id',
142 'type' => CRM_Utils_Type
::T_INT
,
143 'title' => ts('Entity ID') ,
145 'table_name' => 'civicrm_entity_financial_trxn',
146 'entity' => 'EntityFinancialTrxn',
147 'bao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
150 'financial_trxn_id' => array(
151 'name' => 'financial_trxn_id',
152 'type' => CRM_Utils_Type
::T_INT
,
153 'title' => ts('Financial Transaction Id') ,
154 'table_name' => 'civicrm_entity_financial_trxn',
155 'entity' => 'EntityFinancialTrxn',
156 'bao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
158 'FKClassName' => 'CRM_Financial_DAO_FinancialTrxn',
162 'type' => CRM_Utils_Type
::T_MONEY
,
163 'title' => ts('Amount') ,
164 'description' => 'allocated amount of transaction to this entity',
166 'precision' => array(
171 'where' => 'civicrm_entity_financial_trxn.amount',
172 'headerPattern' => '/amount/i',
173 'dataPattern' => '/^\d+(\.\d{2})?$/',
175 'table_name' => 'civicrm_entity_financial_trxn',
176 'entity' => 'EntityFinancialTrxn',
177 'bao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
181 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
183 return Civi
::$statics[__CLASS__
]['fields'];
186 * Return a mapping from field-name to the corresponding key (as used in fields()).
189 * Array(string $name => string $uniqueName).
191 static function &fieldKeys() {
192 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
193 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
195 return Civi
::$statics[__CLASS__
]['fieldKeys'];
198 * Returns the names of this table
202 static function getTableName() {
203 return self
::$_tableName;
206 * Returns if this table needs to be logged
214 * Returns the list of fields that can be imported
216 * @param bool $prefix
220 static function &import($prefix = false) {
221 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'entity_financial_trxn', $prefix, array());
225 * Returns the list of fields that can be exported
227 * @param bool $prefix
231 static function &export($prefix = false) {
232 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'entity_financial_trxn', $prefix, array());
236 * Returns the list of indices
238 public static function indices($localize = TRUE) {
240 'UI_entity_financial_trxn_entity_table' => array(
241 'name' => 'UI_entity_financial_trxn_entity_table',
245 'localizable' => false,
246 'sig' => 'civicrm_entity_financial_trxn::0::entity_table',
248 'UI_entity_financial_trxn_entity_id' => array(
249 'name' => 'UI_entity_financial_trxn_entity_id',
253 'localizable' => false,
254 'sig' => 'civicrm_entity_financial_trxn::0::entity_id',
257 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;