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:5ed0eeb7d3f5f2caf668448cd441b004)
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',
119 'name' => 'entity_table',
120 'type' => CRM_Utils_Type
::T_STRING
,
121 'title' => ts('Entity Table'),
122 'description' => ts('Links to an entity_table like civicrm_financial_type'),
125 'size' => CRM_Utils_Type
::BIG
,
127 'where' => 'civicrm_entity_financial_account.entity_table',
129 'table_name' => 'civicrm_entity_financial_account',
130 'entity' => 'EntityFinancialAccount',
131 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
136 'name' => 'entity_id',
137 'type' => CRM_Utils_Type
::T_INT
,
138 'title' => ts('Entity ID'),
139 'description' => ts('Links to an id in the entity_table, such as vid in civicrm_financial_type'),
141 'where' => 'civicrm_entity_financial_account.entity_id',
142 'table_name' => 'civicrm_entity_financial_account',
143 'entity' => 'EntityFinancialAccount',
144 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
148 'account_relationship' => [
149 'name' => 'account_relationship',
150 'type' => CRM_Utils_Type
::T_INT
,
151 'title' => ts('Account Relationship'),
152 'description' => ts('FK to a new civicrm_option_value (account_relationship)'),
154 'where' => 'civicrm_entity_financial_account.account_relationship',
155 'table_name' => 'civicrm_entity_financial_account',
156 'entity' => 'EntityFinancialAccount',
157 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
162 'pseudoconstant' => [
163 'optionGroupName' => 'account_relationship',
164 'optionEditPath' => 'civicrm/admin/options/account_relationship',
168 'financial_account_id' => [
169 'name' => 'financial_account_id',
170 'type' => CRM_Utils_Type
::T_INT
,
171 'title' => ts('Financial Account'),
172 'description' => ts('FK to the financial_account_id'),
174 'where' => 'civicrm_entity_financial_account.financial_account_id',
175 'table_name' => 'civicrm_entity_financial_account',
176 'entity' => 'EntityFinancialAccount',
177 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
179 'FKClassName' => 'CRM_Financial_DAO_FinancialAccount',
183 'pseudoconstant' => [
184 'table' => 'civicrm_financial_account',
186 'labelColumn' => 'name',
191 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
193 return Civi
::$statics[__CLASS__
]['fields'];
197 * Return a mapping from field-name to the corresponding key (as used in fields()).
200 * Array(string $name => string $uniqueName).
202 public static function &fieldKeys() {
203 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
204 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
206 return Civi
::$statics[__CLASS__
]['fieldKeys'];
210 * Returns the names of this table
214 public static function getTableName() {
215 return self
::$_tableName;
219 * Returns if this table needs to be logged
223 public function getLog() {
228 * Returns the list of fields that can be imported
230 * @param bool $prefix
234 public static function &import($prefix = FALSE) {
235 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'entity_financial_account', $prefix, []);
240 * Returns the list of fields that can be exported
242 * @param bool $prefix
246 public static function &export($prefix = FALSE) {
247 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'entity_financial_account', $prefix, []);
252 * Returns the list of indices
254 * @param bool $localize
258 public static function indices($localize = TRUE) {
260 'index_entity_id_entity_table_account_relationship' => [
261 'name' => 'index_entity_id_entity_table_account_relationship',
265 2 => 'account_relationship',
267 'localizable' => FALSE,
269 'sig' => 'civicrm_entity_financial_account::1::entity_id::entity_table::account_relationship',
272 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;