Merge pull request #13337 from GinkgoFJG/crmPageTitle
[civicrm-core.git] / CRM / Financial / DAO / Currency.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
6b83d5bd 5 * @copyright CiviCRM LLC (c) 2004-2019
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Financial/Currency.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
e380ee3b 9 * (GenCodeChecksum:19729d25ea5ad98f3fc2551acab9fa7a)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the Currency entity.
f41f0342 14 */
e501603b 15class CRM_Financial_DAO_Currency extends CRM_Core_DAO {
c3fc2621 16
e501603b 17 /**
f41f0342 18 * Static instance to hold the table name.
e501603b
TO
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_currency';
c3fc2621 23
e501603b 24 /**
f41f0342 25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 26 *
c3fc2621 27 * @var bool
e501603b 28 */
c3fc2621
CW
29 static $_log = TRUE;
30
e501603b
TO
31 /**
32 * Currency Id
33 *
34 * @var int unsigned
35 */
36 public $id;
c3fc2621 37
e501603b
TO
38 /**
39 * Currency Name
40 *
41 * @var string
42 */
43 public $name;
c3fc2621 44
e501603b
TO
45 /**
46 * Currency Symbol
47 *
48 * @var string
49 */
50 public $symbol;
c3fc2621 51
e501603b
TO
52 /**
53 * Numeric currency code
54 *
55 * @var string
56 */
57 public $numeric_code;
c3fc2621 58
e501603b
TO
59 /**
60 * Full currency name
61 *
62 * @var string
63 */
64 public $full_name;
c3fc2621 65
e501603b 66 /**
f41f0342 67 * Class constructor.
e501603b 68 */
c3fc2621 69 public function __construct() {
e501603b
TO
70 $this->__table = 'civicrm_currency';
71 parent::__construct();
72 }
c3fc2621 73
e501603b
TO
74 /**
75 * Returns all the column names of this table
76 *
77 * @return array
78 */
c3fc2621 79 public static function &fields() {
346aaaba 80 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
81 Civi::$statics[__CLASS__]['fields'] = [
82 'id' => [
e501603b
TO
83 'name' => 'id',
84 'type' => CRM_Utils_Type::T_INT,
c3fc2621 85 'title' => ts('Currency ID'),
215b423e 86 'description' => ts('Currency Id'),
c3fc2621 87 'required' => TRUE,
522a26c9 88 'table_name' => 'civicrm_currency',
89 'entity' => 'Currency',
90 'bao' => 'CRM_Financial_DAO_Currency',
6a7e5e5d 91 'localizable' => 0,
c3fc2621
CW
92 ],
93 'name' => [
e501603b
TO
94 'name' => 'name',
95 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 96 'title' => ts('Currency'),
215b423e 97 'description' => ts('Currency Name'),
e501603b
TO
98 'maxlength' => 64,
99 'size' => CRM_Utils_Type::BIG,
c3fc2621 100 'import' => TRUE,
e501603b
TO
101 'where' => 'civicrm_currency.name',
102 'headerPattern' => '',
103 'dataPattern' => '',
c3fc2621 104 'export' => TRUE,
522a26c9 105 'table_name' => 'civicrm_currency',
106 'entity' => 'Currency',
107 'bao' => 'CRM_Financial_DAO_Currency',
6a7e5e5d 108 'localizable' => 0,
c3fc2621 109 'html' => [
e501603b 110 'type' => 'Text',
c3fc2621
CW
111 ],
112 ],
113 'symbol' => [
e501603b
TO
114 'name' => 'symbol',
115 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 116 'title' => ts('Currency Symbol'),
215b423e 117 'description' => ts('Currency Symbol'),
e501603b
TO
118 'maxlength' => 8,
119 'size' => CRM_Utils_Type::EIGHT,
522a26c9 120 'table_name' => 'civicrm_currency',
121 'entity' => 'Currency',
122 'bao' => 'CRM_Financial_DAO_Currency',
6a7e5e5d 123 'localizable' => 0,
c3fc2621 124 'html' => [
e501603b 125 'type' => 'Text',
c3fc2621
CW
126 ],
127 ],
128 'numeric_code' => [
e501603b
TO
129 'name' => 'numeric_code',
130 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 131 'title' => ts('Currency Numeric Code'),
215b423e 132 'description' => ts('Numeric currency code'),
e501603b
TO
133 'maxlength' => 3,
134 'size' => CRM_Utils_Type::FOUR,
c3fc2621 135 'import' => TRUE,
e501603b
TO
136 'where' => 'civicrm_currency.numeric_code',
137 'headerPattern' => '',
138 'dataPattern' => '',
c3fc2621 139 'export' => TRUE,
522a26c9 140 'table_name' => 'civicrm_currency',
141 'entity' => 'Currency',
142 'bao' => 'CRM_Financial_DAO_Currency',
6a7e5e5d 143 'localizable' => 0,
c3fc2621
CW
144 ],
145 'full_name' => [
e501603b
TO
146 'name' => 'full_name',
147 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 148 'title' => ts('Full Currency Name'),
215b423e 149 'description' => ts('Full currency name'),
e501603b
TO
150 'maxlength' => 64,
151 'size' => CRM_Utils_Type::BIG,
522a26c9 152 'table_name' => 'civicrm_currency',
153 'entity' => 'Currency',
154 'bao' => 'CRM_Financial_DAO_Currency',
6a7e5e5d 155 'localizable' => 0,
c3fc2621 156 'html' => [
e501603b 157 'type' => 'Text',
c3fc2621
CW
158 ],
159 ],
160 ];
346aaaba 161 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 162 }
346aaaba 163 return Civi::$statics[__CLASS__]['fields'];
e501603b 164 }
c3fc2621 165
e501603b 166 /**
bd8e0b14 167 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
168 *
169 * @return array
bd8e0b14 170 * Array(string $name => string $uniqueName).
e501603b 171 */
c3fc2621 172 public static function &fieldKeys() {
bd8e0b14
TO
173 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
174 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 175 }
bd8e0b14 176 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 177 }
c3fc2621 178
e501603b
TO
179 /**
180 * Returns the names of this table
181 *
182 * @return string
183 */
c3fc2621 184 public static function getTableName() {
e501603b
TO
185 return self::$_tableName;
186 }
c3fc2621 187
e501603b
TO
188 /**
189 * Returns if this table needs to be logged
190 *
c3fc2621 191 * @return bool
e501603b 192 */
c3fc2621 193 public function getLog() {
e501603b
TO
194 return self::$_log;
195 }
c3fc2621 196
e501603b
TO
197 /**
198 * Returns the list of fields that can be imported
199 *
200 * @param bool $prefix
201 *
202 * @return array
203 */
c3fc2621
CW
204 public static function &import($prefix = FALSE) {
205 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'currency', $prefix, []);
60808919 206 return $r;
e501603b 207 }
c3fc2621 208
e501603b
TO
209 /**
210 * Returns the list of fields that can be exported
211 *
212 * @param bool $prefix
213 *
214 * @return array
215 */
c3fc2621
CW
216 public static function &export($prefix = FALSE) {
217 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'currency', $prefix, []);
60808919 218 return $r;
e501603b 219 }
c3fc2621 220
e7a6b91a
AS
221 /**
222 * Returns the list of indices
c3fc2621
CW
223 *
224 * @param bool $localize
225 *
226 * @return array
e7a6b91a
AS
227 */
228 public static function indices($localize = TRUE) {
c3fc2621 229 $indices = [];
e7a6b91a
AS
230 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
231 }
c3fc2621 232
e501603b 233}