5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Financial/Currency.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:deb271a4217800d258244eab0eec2af5)
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 'where' => 'civicrm_currency.id',
89 'table_name' => 'civicrm_currency',
90 'entity' => 'Currency',
91 'bao' => 'CRM_Financial_DAO_Currency',
96 'type' => CRM_Utils_Type
::T_STRING
,
97 'title' => ts('Currency'),
98 'description' => ts('Currency Name'),
100 'size' => CRM_Utils_Type
::BIG
,
102 'where' => 'civicrm_currency.name',
104 'table_name' => 'civicrm_currency',
105 'entity' => 'Currency',
106 'bao' => 'CRM_Financial_DAO_Currency',
114 'type' => CRM_Utils_Type
::T_STRING
,
115 'title' => ts('Currency Symbol'),
116 'description' => ts('Currency Symbol'),
118 'size' => CRM_Utils_Type
::EIGHT
,
119 'where' => 'civicrm_currency.symbol',
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',
138 'table_name' => 'civicrm_currency',
139 'entity' => 'Currency',
140 'bao' => 'CRM_Financial_DAO_Currency',
144 'name' => 'full_name',
145 'type' => CRM_Utils_Type
::T_STRING
,
146 'title' => ts('Full Currency Name'),
147 'description' => ts('Full currency name'),
149 'size' => CRM_Utils_Type
::BIG
,
150 'where' => 'civicrm_currency.full_name',
151 'table_name' => 'civicrm_currency',
152 'entity' => 'Currency',
153 'bao' => 'CRM_Financial_DAO_Currency',
160 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
162 return Civi
::$statics[__CLASS__
]['fields'];
166 * Return a mapping from field-name to the corresponding key (as used in fields()).
169 * Array(string $name => string $uniqueName).
171 public static function &fieldKeys() {
172 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
173 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
175 return Civi
::$statics[__CLASS__
]['fieldKeys'];
179 * Returns the names of this table
183 public static function getTableName() {
184 return self
::$_tableName;
188 * Returns if this table needs to be logged
192 public function getLog() {
197 * Returns the list of fields that can be imported
199 * @param bool $prefix
203 public static function &import($prefix = FALSE) {
204 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'currency', $prefix, []);
209 * Returns the list of fields that can be exported
211 * @param bool $prefix
215 public static function &export($prefix = FALSE) {
216 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'currency', $prefix, []);
221 * Returns the list of indices
223 * @param bool $localize
227 public static function indices($localize = TRUE) {
229 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;