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:a9172e230dd513e6a06f5fec2e0ddb90)
13 * Database access object for the Currency entity.
15 class CRM_Financial_DAO_Currency
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.7';
18 const COMPONENT
= 'CiviContribute';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_currency';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = TRUE;
56 * Numeric currency code
72 public function __construct() {
73 $this->__table
= 'civicrm_currency';
74 parent
::__construct();
78 * Returns localized title of this entity.
81 * Whether to return the plural version of the title.
83 public static function getEntityTitle($plural = FALSE) {
84 return $plural ?
ts('Currencies') : ts('Currency');
88 * Returns all the column names of this table
92 public static function &fields() {
93 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
94 Civi
::$statics[__CLASS__
]['fields'] = [
97 'type' => CRM_Utils_Type
::T_INT
,
98 'title' => ts('Currency ID'),
99 'description' => ts('Currency Id'),
101 'where' => 'civicrm_currency.id',
102 'table_name' => 'civicrm_currency',
103 'entity' => 'Currency',
104 'bao' => 'CRM_Financial_DAO_Currency',
110 'type' => CRM_Utils_Type
::T_STRING
,
111 'title' => ts('Currency'),
112 'description' => ts('Currency Name'),
114 'size' => CRM_Utils_Type
::BIG
,
116 'where' => 'civicrm_currency.name',
118 'table_name' => 'civicrm_currency',
119 'entity' => 'Currency',
120 'bao' => 'CRM_Financial_DAO_Currency',
129 'type' => CRM_Utils_Type
::T_STRING
,
130 'title' => ts('Currency Symbol'),
131 'description' => ts('Currency Symbol'),
133 'size' => CRM_Utils_Type
::EIGHT
,
134 'where' => 'civicrm_currency.symbol',
135 'table_name' => 'civicrm_currency',
136 'entity' => 'Currency',
137 'bao' => 'CRM_Financial_DAO_Currency',
145 'name' => 'numeric_code',
146 'type' => CRM_Utils_Type
::T_STRING
,
147 'title' => ts('Currency Numeric Code'),
148 'description' => ts('Numeric currency code'),
150 'size' => CRM_Utils_Type
::FOUR
,
152 'where' => 'civicrm_currency.numeric_code',
154 'table_name' => 'civicrm_currency',
155 'entity' => 'Currency',
156 'bao' => 'CRM_Financial_DAO_Currency',
161 'name' => 'full_name',
162 'type' => CRM_Utils_Type
::T_STRING
,
163 'title' => ts('Full Currency Name'),
164 'description' => ts('Full currency name'),
166 'size' => CRM_Utils_Type
::BIG
,
167 'where' => 'civicrm_currency.full_name',
168 'table_name' => 'civicrm_currency',
169 'entity' => 'Currency',
170 'bao' => 'CRM_Financial_DAO_Currency',
178 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
180 return Civi
::$statics[__CLASS__
]['fields'];
184 * Return a mapping from field-name to the corresponding key (as used in fields()).
187 * Array(string $name => string $uniqueName).
189 public static function &fieldKeys() {
190 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
191 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
193 return Civi
::$statics[__CLASS__
]['fieldKeys'];
197 * Returns the names of this table
201 public static function getTableName() {
202 return self
::$_tableName;
206 * Returns if this table needs to be logged
210 public function getLog() {
215 * Returns the list of fields that can be imported
217 * @param bool $prefix
221 public static function &import($prefix = FALSE) {
222 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'currency', $prefix, []);
227 * Returns the list of fields that can be exported
229 * @param bool $prefix
233 public static function &export($prefix = FALSE) {
234 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'currency', $prefix, []);
239 * Returns the list of indices
241 * @param bool $localize
245 public static function indices($localize = TRUE) {
247 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;