5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Financial/Currency.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:19729d25ea5ad98f3fc2551acab9fa7a)
13 * Database access object for the Currency entity.
15 class CRM_Financial_DAO_Currency
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_currency';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
53 * Numeric currency code
69 public function __construct() {
70 $this->__table
= 'civicrm_currency';
71 parent
::__construct();
75 * Returns all the column names of this table
79 public static function &fields() {
80 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
81 Civi
::$statics[__CLASS__
]['fields'] = [
84 'type' => CRM_Utils_Type
::T_INT
,
85 'title' => ts('Currency ID'),
86 'description' => ts('Currency Id'),
88 'table_name' => 'civicrm_currency',
89 'entity' => 'Currency',
90 'bao' => 'CRM_Financial_DAO_Currency',
95 'type' => CRM_Utils_Type
::T_STRING
,
96 'title' => ts('Currency'),
97 'description' => ts('Currency Name'),
99 'size' => CRM_Utils_Type
::BIG
,
101 'where' => 'civicrm_currency.name',
102 'headerPattern' => '',
105 'table_name' => 'civicrm_currency',
106 'entity' => 'Currency',
107 'bao' => 'CRM_Financial_DAO_Currency',
115 'type' => CRM_Utils_Type
::T_STRING
,
116 'title' => ts('Currency Symbol'),
117 'description' => ts('Currency Symbol'),
119 'size' => CRM_Utils_Type
::EIGHT
,
120 'table_name' => 'civicrm_currency',
121 'entity' => 'Currency',
122 'bao' => 'CRM_Financial_DAO_Currency',
129 'name' => 'numeric_code',
130 'type' => CRM_Utils_Type
::T_STRING
,
131 'title' => ts('Currency Numeric Code'),
132 'description' => ts('Numeric currency code'),
134 'size' => CRM_Utils_Type
::FOUR
,
136 'where' => 'civicrm_currency.numeric_code',
137 'headerPattern' => '',
140 'table_name' => 'civicrm_currency',
141 'entity' => 'Currency',
142 'bao' => 'CRM_Financial_DAO_Currency',
146 'name' => 'full_name',
147 'type' => CRM_Utils_Type
::T_STRING
,
148 'title' => ts('Full Currency Name'),
149 'description' => ts('Full currency name'),
151 'size' => CRM_Utils_Type
::BIG
,
152 'table_name' => 'civicrm_currency',
153 'entity' => 'Currency',
154 'bao' => 'CRM_Financial_DAO_Currency',
161 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
163 return Civi
::$statics[__CLASS__
]['fields'];
167 * Return a mapping from field-name to the corresponding key (as used in fields()).
170 * Array(string $name => string $uniqueName).
172 public static function &fieldKeys() {
173 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
174 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
176 return Civi
::$statics[__CLASS__
]['fieldKeys'];
180 * Returns the names of this table
184 public static function getTableName() {
185 return self
::$_tableName;
189 * Returns if this table needs to be logged
193 public function getLog() {
198 * Returns the list of fields that can be imported
200 * @param bool $prefix
204 public static function &import($prefix = FALSE) {
205 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'currency', $prefix, []);
210 * Returns the list of fields that can be exported
212 * @param bool $prefix
216 public static function &export($prefix = FALSE) {
217 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'currency', $prefix, []);
222 * Returns the list of indices
224 * @param bool $localize
228 public static function indices($localize = TRUE) {
230 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;