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:9141d433586789f5ea9003fdbe9fdf9b)
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',
104 'type' => CRM_Utils_Type
::T_STRING
,
105 'title' => ts('Currency'),
106 'description' => ts('Currency Name'),
108 'size' => CRM_Utils_Type
::BIG
,
110 'where' => 'civicrm_currency.name',
112 'table_name' => 'civicrm_currency',
113 'entity' => 'Currency',
114 'bao' => 'CRM_Financial_DAO_Currency',
123 'type' => CRM_Utils_Type
::T_STRING
,
124 'title' => ts('Currency Symbol'),
125 'description' => ts('Currency Symbol'),
127 'size' => CRM_Utils_Type
::EIGHT
,
128 'where' => 'civicrm_currency.symbol',
129 'table_name' => 'civicrm_currency',
130 'entity' => 'Currency',
131 'bao' => 'CRM_Financial_DAO_Currency',
139 'name' => 'numeric_code',
140 'type' => CRM_Utils_Type
::T_STRING
,
141 'title' => ts('Currency Numeric Code'),
142 'description' => ts('Numeric currency code'),
144 'size' => CRM_Utils_Type
::FOUR
,
146 'where' => 'civicrm_currency.numeric_code',
148 'table_name' => 'civicrm_currency',
149 'entity' => 'Currency',
150 'bao' => 'CRM_Financial_DAO_Currency',
155 'name' => 'full_name',
156 'type' => CRM_Utils_Type
::T_STRING
,
157 'title' => ts('Full Currency Name'),
158 'description' => ts('Full currency name'),
160 'size' => CRM_Utils_Type
::BIG
,
161 'where' => 'civicrm_currency.full_name',
162 'table_name' => 'civicrm_currency',
163 'entity' => 'Currency',
164 'bao' => 'CRM_Financial_DAO_Currency',
172 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
174 return Civi
::$statics[__CLASS__
]['fields'];
178 * Return a mapping from field-name to the corresponding key (as used in fields()).
181 * Array(string $name => string $uniqueName).
183 public static function &fieldKeys() {
184 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
185 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
187 return Civi
::$statics[__CLASS__
]['fieldKeys'];
191 * Returns the names of this table
195 public static function getTableName() {
196 return self
::$_tableName;
200 * Returns if this table needs to be logged
204 public function getLog() {
209 * Returns the list of fields that can be imported
211 * @param bool $prefix
215 public static function &import($prefix = FALSE) {
216 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'currency', $prefix, []);
221 * Returns the list of fields that can be exported
223 * @param bool $prefix
227 public static function &export($prefix = FALSE) {
228 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'currency', $prefix, []);
233 * Returns the list of indices
235 * @param bool $localize
239 public static function indices($localize = TRUE) {
241 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;