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:04ae90cfa08b3e1380f48c64e0bcc1ce)
13 * Database access object for the EntityFinancialAccount entity.
15 class CRM_Financial_DAO_EntityFinancialAccount
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '4.3';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_entity_financial_account';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = TRUE;
41 * Links to an entity_table like civicrm_financial_type
48 * Links to an id in the entity_table, such as vid in civicrm_financial_type
55 * FK to a new civicrm_option_value (account_relationship)
59 public $account_relationship;
62 * FK to the financial_account_id
66 public $financial_account_id;
71 public function __construct() {
72 $this->__table
= 'civicrm_entity_financial_account';
73 parent
::__construct();
77 * Returns localized title of this entity.
80 * Whether to return the plural version of the title.
82 public static function getEntityTitle($plural = FALSE) {
83 return $plural ?
ts('Entity Financial Accounts') : ts('Entity Financial Account');
87 * Returns foreign keys and entity references.
90 * [CRM_Core_Reference_Interface]
92 public static function getReferenceColumns() {
93 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
94 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
95 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'financial_account_id', 'civicrm_financial_account', 'id');
96 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
97 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
99 return Civi
::$statics[__CLASS__
]['links'];
103 * Returns all the column names of this table
107 public static function &fields() {
108 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
109 Civi
::$statics[__CLASS__
]['fields'] = [
112 'type' => CRM_Utils_Type
::T_INT
,
113 'title' => ts('Entity Financial Account ID'),
114 'description' => ts('ID'),
116 'where' => 'civicrm_entity_financial_account.id',
117 'table_name' => 'civicrm_entity_financial_account',
118 'entity' => 'EntityFinancialAccount',
119 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
124 'name' => 'entity_table',
125 'type' => CRM_Utils_Type
::T_STRING
,
126 'title' => ts('Entity Table'),
127 'description' => ts('Links to an entity_table like civicrm_financial_type'),
130 'size' => CRM_Utils_Type
::BIG
,
132 'where' => 'civicrm_entity_financial_account.entity_table',
134 'table_name' => 'civicrm_entity_financial_account',
135 'entity' => 'EntityFinancialAccount',
136 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
141 'name' => 'entity_id',
142 'type' => CRM_Utils_Type
::T_INT
,
143 'title' => ts('Entity ID'),
144 'description' => ts('Links to an id in the entity_table, such as vid in civicrm_financial_type'),
146 'where' => 'civicrm_entity_financial_account.entity_id',
147 'table_name' => 'civicrm_entity_financial_account',
148 'entity' => 'EntityFinancialAccount',
149 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
153 'account_relationship' => [
154 'name' => 'account_relationship',
155 'type' => CRM_Utils_Type
::T_INT
,
156 'title' => ts('Account Relationship'),
157 'description' => ts('FK to a new civicrm_option_value (account_relationship)'),
159 'where' => 'civicrm_entity_financial_account.account_relationship',
160 'table_name' => 'civicrm_entity_financial_account',
161 'entity' => 'EntityFinancialAccount',
162 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
167 'pseudoconstant' => [
168 'optionGroupName' => 'account_relationship',
169 'optionEditPath' => 'civicrm/admin/options/account_relationship',
173 'financial_account_id' => [
174 'name' => 'financial_account_id',
175 'type' => CRM_Utils_Type
::T_INT
,
176 'title' => ts('Financial Account'),
177 'description' => ts('FK to the financial_account_id'),
179 'where' => 'civicrm_entity_financial_account.financial_account_id',
180 'table_name' => 'civicrm_entity_financial_account',
181 'entity' => 'EntityFinancialAccount',
182 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
184 'FKClassName' => 'CRM_Financial_DAO_FinancialAccount',
188 'pseudoconstant' => [
189 'table' => 'civicrm_financial_account',
191 'labelColumn' => 'name',
196 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
198 return Civi
::$statics[__CLASS__
]['fields'];
202 * Return a mapping from field-name to the corresponding key (as used in fields()).
205 * Array(string $name => string $uniqueName).
207 public static function &fieldKeys() {
208 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
209 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
211 return Civi
::$statics[__CLASS__
]['fieldKeys'];
215 * Returns the names of this table
219 public static function getTableName() {
220 return self
::$_tableName;
224 * Returns if this table needs to be logged
228 public function getLog() {
233 * Returns the list of fields that can be imported
235 * @param bool $prefix
239 public static function &import($prefix = FALSE) {
240 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'entity_financial_account', $prefix, []);
245 * Returns the list of fields that can be exported
247 * @param bool $prefix
251 public static function &export($prefix = FALSE) {
252 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'entity_financial_account', $prefix, []);
257 * Returns the list of indices
259 * @param bool $localize
263 public static function indices($localize = TRUE) {
265 'index_entity_id_entity_table_account_relationship' => [
266 'name' => 'index_entity_id_entity_table_account_relationship',
270 2 => 'account_relationship',
272 'localizable' => FALSE,
274 'sig' => 'civicrm_entity_financial_account::1::entity_id::entity_table::account_relationship',
277 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;