5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Financial/EntityFinancialAccount.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:52f632fb4083dc1e94f1d252a4eeec99)
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 localized title of this entity.
77 public static function getEntityTitle() {
78 return ts('Entity Financial Accounts');
82 * Returns foreign keys and entity references.
85 * [CRM_Core_Reference_Interface]
87 public static function getReferenceColumns() {
88 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
89 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
90 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'financial_account_id', 'civicrm_financial_account', 'id');
91 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
92 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
94 return Civi
::$statics[__CLASS__
]['links'];
98 * Returns all the column names of this table
102 public static function &fields() {
103 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
104 Civi
::$statics[__CLASS__
]['fields'] = [
107 'type' => CRM_Utils_Type
::T_INT
,
108 'title' => ts('Entity Financial Account ID'),
109 'description' => ts('ID'),
111 'where' => 'civicrm_entity_financial_account.id',
112 'table_name' => 'civicrm_entity_financial_account',
113 'entity' => 'EntityFinancialAccount',
114 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
118 'name' => 'entity_table',
119 'type' => CRM_Utils_Type
::T_STRING
,
120 'title' => ts('Entity Table'),
121 'description' => ts('Links to an entity_table like civicrm_financial_type'),
124 'size' => CRM_Utils_Type
::BIG
,
126 'where' => 'civicrm_entity_financial_account.entity_table',
128 'table_name' => 'civicrm_entity_financial_account',
129 'entity' => 'EntityFinancialAccount',
130 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
134 'name' => 'entity_id',
135 'type' => CRM_Utils_Type
::T_INT
,
136 'title' => ts('Entity ID'),
137 'description' => ts('Links to an id in the entity_table, such as vid in civicrm_financial_type'),
139 'where' => 'civicrm_entity_financial_account.entity_id',
140 'table_name' => 'civicrm_entity_financial_account',
141 'entity' => 'EntityFinancialAccount',
142 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
145 'account_relationship' => [
146 'name' => 'account_relationship',
147 'type' => CRM_Utils_Type
::T_INT
,
148 'title' => ts('Account Relationship'),
149 'description' => ts('FK to a new civicrm_option_value (account_relationship)'),
151 'where' => 'civicrm_entity_financial_account.account_relationship',
152 'table_name' => 'civicrm_entity_financial_account',
153 'entity' => 'EntityFinancialAccount',
154 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
159 'pseudoconstant' => [
160 'optionGroupName' => 'account_relationship',
161 'optionEditPath' => 'civicrm/admin/options/account_relationship',
164 'financial_account_id' => [
165 'name' => 'financial_account_id',
166 'type' => CRM_Utils_Type
::T_INT
,
167 'title' => ts('Financial Account'),
168 'description' => ts('FK to the financial_account_id'),
170 'where' => 'civicrm_entity_financial_account.financial_account_id',
171 'table_name' => 'civicrm_entity_financial_account',
172 'entity' => 'EntityFinancialAccount',
173 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
175 'FKClassName' => 'CRM_Financial_DAO_FinancialAccount',
179 'pseudoconstant' => [
180 'table' => 'civicrm_financial_account',
182 'labelColumn' => 'name',
186 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
188 return Civi
::$statics[__CLASS__
]['fields'];
192 * Return a mapping from field-name to the corresponding key (as used in fields()).
195 * Array(string $name => string $uniqueName).
197 public static function &fieldKeys() {
198 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
199 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
201 return Civi
::$statics[__CLASS__
]['fieldKeys'];
205 * Returns the names of this table
209 public static function getTableName() {
210 return self
::$_tableName;
214 * Returns if this table needs to be logged
218 public function getLog() {
223 * Returns the list of fields that can be imported
225 * @param bool $prefix
229 public static function &import($prefix = FALSE) {
230 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'entity_financial_account', $prefix, []);
235 * Returns the list of fields that can be exported
237 * @param bool $prefix
241 public static function &export($prefix = FALSE) {
242 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'entity_financial_account', $prefix, []);
247 * Returns the list of indices
249 * @param bool $localize
253 public static function indices($localize = TRUE) {
255 'index_entity_id_entity_table_account_relationship' => [
256 'name' => 'index_entity_id_entity_table_account_relationship',
260 2 => 'account_relationship',
262 'localizable' => FALSE,
264 'sig' => 'civicrm_entity_financial_account::1::entity_id::entity_table::account_relationship',
267 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;