5 * @copyright CiviCRM LLC (c) 2004-2020
7 * Generated from xml/schema/CRM/Financial/EntityFinancialAccount.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:9d665341d7a4293411adf33acafdae1d)
13 * Database access object for the EntityFinancialAccount entity.
15 class CRM_Financial_DAO_EntityFinancialAccount
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_entity_financial_account';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
39 * Links to an entity_table like civicrm_financial_type
46 * Links to an id in the entity_table, such as vid in civicrm_financial_type
53 * FK to a new civicrm_option_value (account_relationship)
57 public $account_relationship;
60 * FK to the financial_account_id
64 public $financial_account_id;
69 public function __construct() {
70 $this->__table
= 'civicrm_entity_financial_account';
71 parent
::__construct();
75 * Returns foreign keys and entity references.
78 * [CRM_Core_Reference_Interface]
80 public static function getReferenceColumns() {
81 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
82 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
83 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'financial_account_id', 'civicrm_financial_account', 'id');
84 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
85 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
87 return Civi
::$statics[__CLASS__
]['links'];
91 * Returns all the column names of this table
95 public static function &fields() {
96 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
97 Civi
::$statics[__CLASS__
]['fields'] = [
100 'type' => CRM_Utils_Type
::T_INT
,
101 'title' => ts('Entity Financial Account ID'),
102 'description' => ts('ID'),
104 'where' => 'civicrm_entity_financial_account.id',
105 'table_name' => 'civicrm_entity_financial_account',
106 'entity' => 'EntityFinancialAccount',
107 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
111 'name' => 'entity_table',
112 'type' => CRM_Utils_Type
::T_STRING
,
113 'title' => ts('Entity Table'),
114 'description' => ts('Links to an entity_table like civicrm_financial_type'),
117 'size' => CRM_Utils_Type
::BIG
,
119 'where' => 'civicrm_entity_financial_account.entity_table',
121 'table_name' => 'civicrm_entity_financial_account',
122 'entity' => 'EntityFinancialAccount',
123 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
127 'name' => 'entity_id',
128 'type' => CRM_Utils_Type
::T_INT
,
129 'title' => ts('Entity ID'),
130 'description' => ts('Links to an id in the entity_table, such as vid in civicrm_financial_type'),
132 'where' => 'civicrm_entity_financial_account.entity_id',
133 'table_name' => 'civicrm_entity_financial_account',
134 'entity' => 'EntityFinancialAccount',
135 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
138 'account_relationship' => [
139 'name' => 'account_relationship',
140 'type' => CRM_Utils_Type
::T_INT
,
141 'title' => ts('Account Relationship'),
142 'description' => ts('FK to a new civicrm_option_value (account_relationship)'),
144 'where' => 'civicrm_entity_financial_account.account_relationship',
145 'table_name' => 'civicrm_entity_financial_account',
146 'entity' => 'EntityFinancialAccount',
147 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
152 'pseudoconstant' => [
153 'optionGroupName' => 'account_relationship',
154 'optionEditPath' => 'civicrm/admin/options/account_relationship',
157 'financial_account_id' => [
158 'name' => 'financial_account_id',
159 'type' => CRM_Utils_Type
::T_INT
,
160 'title' => ts('Financial Account'),
161 'description' => ts('FK to the financial_account_id'),
163 'where' => 'civicrm_entity_financial_account.financial_account_id',
164 'table_name' => 'civicrm_entity_financial_account',
165 'entity' => 'EntityFinancialAccount',
166 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
168 'FKClassName' => 'CRM_Financial_DAO_FinancialAccount',
172 'pseudoconstant' => [
173 'table' => 'civicrm_financial_account',
175 'labelColumn' => 'name',
179 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
181 return Civi
::$statics[__CLASS__
]['fields'];
185 * Return a mapping from field-name to the corresponding key (as used in fields()).
188 * Array(string $name => string $uniqueName).
190 public static function &fieldKeys() {
191 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
192 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
194 return Civi
::$statics[__CLASS__
]['fieldKeys'];
198 * Returns the names of this table
202 public static function getTableName() {
203 return self
::$_tableName;
207 * Returns if this table needs to be logged
211 public function getLog() {
216 * Returns the list of fields that can be imported
218 * @param bool $prefix
222 public static function &import($prefix = FALSE) {
223 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'entity_financial_account', $prefix, []);
228 * Returns the list of fields that can be exported
230 * @param bool $prefix
234 public static function &export($prefix = FALSE) {
235 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'entity_financial_account', $prefix, []);
240 * Returns the list of indices
242 * @param bool $localize
246 public static function indices($localize = TRUE) {
248 'index_entity_id_entity_table_account_relationship' => [
249 'name' => 'index_entity_id_entity_table_account_relationship',
253 2 => 'account_relationship',
255 'localizable' => FALSE,
257 'sig' => 'civicrm_entity_financial_account::1::entity_id::entity_table::account_relationship',
260 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;