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:37f7754e31fe685b29f1e04a13264253)
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 localized title of this entity.
77 public static function getEntityTitle() {
78 return ts('Currencies');
82 * Returns all the column names of this table
86 public static function &fields() {
87 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
88 Civi
::$statics[__CLASS__
]['fields'] = [
91 'type' => CRM_Utils_Type
::T_INT
,
92 'title' => ts('Currency ID'),
93 'description' => ts('Currency Id'),
95 'where' => 'civicrm_currency.id',
96 'table_name' => 'civicrm_currency',
97 'entity' => 'Currency',
98 'bao' => 'CRM_Financial_DAO_Currency',
103 'type' => CRM_Utils_Type
::T_STRING
,
104 'title' => ts('Currency'),
105 'description' => ts('Currency Name'),
107 'size' => CRM_Utils_Type
::BIG
,
109 'where' => 'civicrm_currency.name',
111 'table_name' => 'civicrm_currency',
112 'entity' => 'Currency',
113 'bao' => 'CRM_Financial_DAO_Currency',
121 'type' => CRM_Utils_Type
::T_STRING
,
122 'title' => ts('Currency Symbol'),
123 'description' => ts('Currency Symbol'),
125 'size' => CRM_Utils_Type
::EIGHT
,
126 'where' => 'civicrm_currency.symbol',
127 'table_name' => 'civicrm_currency',
128 'entity' => 'Currency',
129 'bao' => 'CRM_Financial_DAO_Currency',
136 'name' => 'numeric_code',
137 'type' => CRM_Utils_Type
::T_STRING
,
138 'title' => ts('Currency Numeric Code'),
139 'description' => ts('Numeric currency code'),
141 'size' => CRM_Utils_Type
::FOUR
,
143 'where' => 'civicrm_currency.numeric_code',
145 'table_name' => 'civicrm_currency',
146 'entity' => 'Currency',
147 'bao' => 'CRM_Financial_DAO_Currency',
151 'name' => 'full_name',
152 'type' => CRM_Utils_Type
::T_STRING
,
153 'title' => ts('Full Currency Name'),
154 'description' => ts('Full currency name'),
156 'size' => CRM_Utils_Type
::BIG
,
157 'where' => 'civicrm_currency.full_name',
158 'table_name' => 'civicrm_currency',
159 'entity' => 'Currency',
160 'bao' => 'CRM_Financial_DAO_Currency',
167 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
169 return Civi
::$statics[__CLASS__
]['fields'];
173 * Return a mapping from field-name to the corresponding key (as used in fields()).
176 * Array(string $name => string $uniqueName).
178 public static function &fieldKeys() {
179 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
180 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
182 return Civi
::$statics[__CLASS__
]['fieldKeys'];
186 * Returns the names of this table
190 public static function getTableName() {
191 return self
::$_tableName;
195 * Returns if this table needs to be logged
199 public function getLog() {
204 * Returns the list of fields that can be imported
206 * @param bool $prefix
210 public static function &import($prefix = FALSE) {
211 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'currency', $prefix, []);
216 * Returns the list of fields that can be exported
218 * @param bool $prefix
222 public static function &export($prefix = FALSE) {
223 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'currency', $prefix, []);
228 * Returns the list of indices
230 * @param bool $localize
234 public static function indices($localize = TRUE) {
236 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;