5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Financial/EntityFinancialAccount.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:b9e9a095e5a6631dd7104828d40ec55a)
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 static $_tableName = 'civicrm_entity_financial_account';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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' => 'ID',
104 'table_name' => 'civicrm_entity_financial_account',
105 'entity' => 'EntityFinancialAccount',
106 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
110 'name' => 'entity_table',
111 'type' => CRM_Utils_Type
::T_STRING
,
112 'title' => ts('Entity Table'),
113 'description' => 'Links to an entity_table like civicrm_financial_type',
116 'size' => CRM_Utils_Type
::BIG
,
118 'where' => 'civicrm_entity_financial_account.entity_table',
119 'headerPattern' => '',
122 'table_name' => 'civicrm_entity_financial_account',
123 'entity' => 'EntityFinancialAccount',
124 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
128 'name' => 'entity_id',
129 'type' => CRM_Utils_Type
::T_INT
,
130 'title' => ts('Entity ID'),
131 'description' => 'Links to an id in the entity_table, such as vid in civicrm_financial_type',
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' => 'FK to a new civicrm_option_value (account_relationship)',
144 'table_name' => 'civicrm_entity_financial_account',
145 'entity' => 'EntityFinancialAccount',
146 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
151 'pseudoconstant' => [
152 'optionGroupName' => 'account_relationship',
153 'optionEditPath' => 'civicrm/admin/options/account_relationship',
156 'financial_account_id' => [
157 'name' => 'financial_account_id',
158 'type' => CRM_Utils_Type
::T_INT
,
159 'title' => ts('Financial Account'),
160 'description' => 'FK to the financial_account_id',
162 'table_name' => 'civicrm_entity_financial_account',
163 'entity' => 'EntityFinancialAccount',
164 'bao' => 'CRM_Financial_DAO_EntityFinancialAccount',
166 'FKClassName' => 'CRM_Financial_DAO_FinancialAccount',
170 'pseudoconstant' => [
171 'table' => 'civicrm_financial_account',
173 'labelColumn' => 'name',
177 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
179 return Civi
::$statics[__CLASS__
]['fields'];
183 * Return a mapping from field-name to the corresponding key (as used in fields()).
186 * Array(string $name => string $uniqueName).
188 public static function &fieldKeys() {
189 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
190 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
192 return Civi
::$statics[__CLASS__
]['fieldKeys'];
196 * Returns the names of this table
200 public static function getTableName() {
201 return self
::$_tableName;
205 * Returns if this table needs to be logged
209 public function getLog() {
214 * Returns the list of fields that can be imported
216 * @param bool $prefix
220 public static function &import($prefix = FALSE) {
221 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'entity_financial_account', $prefix, []);
226 * Returns the list of fields that can be exported
228 * @param bool $prefix
232 public static function &export($prefix = FALSE) {
233 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'entity_financial_account', $prefix, []);
238 * Returns the list of indices
240 * @param bool $localize
244 public static function indices($localize = TRUE) {
246 'index_entity_id_entity_table_account_relationship' => [
247 'name' => 'index_entity_id_entity_table_account_relationship',
251 2 => 'account_relationship',
253 'localizable' => FALSE,
255 'sig' => 'civicrm_entity_financial_account::1::entity_id::entity_table::account_relationship',
258 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;