Commit | Line | Data |
---|---|---|
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 | |
e6ca0a57 | 9 | * (GenCodeChecksum:5490d115dbd495ebb39ce46a4149cbc2) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the Currency entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class 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 | */ | |
fa45b5b9 | 22 | public 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 | */ |
fa45b5b9 | 29 | public static $_log = TRUE; |
c3fc2621 | 30 | |
e501603b TO |
31 | /** |
32 | * Currency Id | |
33 | * | |
e6ca0a57 | 34 | * @var int |
e501603b TO |
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, |
a36434b9 | 88 | 'where' => 'civicrm_currency.id', |
522a26c9 | 89 | 'table_name' => 'civicrm_currency', |
90 | 'entity' => 'Currency', | |
91 | 'bao' => 'CRM_Financial_DAO_Currency', | |
6a7e5e5d | 92 | 'localizable' => 0, |
c3fc2621 CW |
93 | ], |
94 | 'name' => [ | |
e501603b TO |
95 | 'name' => 'name', |
96 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 97 | 'title' => ts('Currency'), |
215b423e | 98 | 'description' => ts('Currency Name'), |
e501603b TO |
99 | 'maxlength' => 64, |
100 | 'size' => CRM_Utils_Type::BIG, | |
c3fc2621 | 101 | 'import' => TRUE, |
e501603b | 102 | 'where' => 'civicrm_currency.name', |
c3fc2621 | 103 | 'export' => TRUE, |
522a26c9 | 104 | 'table_name' => 'civicrm_currency', |
105 | 'entity' => 'Currency', | |
106 | 'bao' => 'CRM_Financial_DAO_Currency', | |
6a7e5e5d | 107 | 'localizable' => 0, |
c3fc2621 | 108 | 'html' => [ |
e501603b | 109 | 'type' => 'Text', |
c3fc2621 CW |
110 | ], |
111 | ], | |
112 | 'symbol' => [ | |
e501603b TO |
113 | 'name' => 'symbol', |
114 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 115 | 'title' => ts('Currency Symbol'), |
215b423e | 116 | 'description' => ts('Currency Symbol'), |
e501603b TO |
117 | 'maxlength' => 8, |
118 | 'size' => CRM_Utils_Type::EIGHT, | |
a36434b9 | 119 | 'where' => 'civicrm_currency.symbol', |
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 | 136 | 'where' => 'civicrm_currency.numeric_code', |
c3fc2621 | 137 | 'export' => TRUE, |
522a26c9 | 138 | 'table_name' => 'civicrm_currency', |
139 | 'entity' => 'Currency', | |
140 | 'bao' => 'CRM_Financial_DAO_Currency', | |
6a7e5e5d | 141 | 'localizable' => 0, |
c3fc2621 CW |
142 | ], |
143 | 'full_name' => [ | |
e501603b TO |
144 | 'name' => 'full_name', |
145 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 146 | 'title' => ts('Full Currency Name'), |
215b423e | 147 | 'description' => ts('Full currency name'), |
e501603b TO |
148 | 'maxlength' => 64, |
149 | 'size' => CRM_Utils_Type::BIG, | |
a36434b9 | 150 | 'where' => 'civicrm_currency.full_name', |
522a26c9 | 151 | 'table_name' => 'civicrm_currency', |
152 | 'entity' => 'Currency', | |
153 | 'bao' => 'CRM_Financial_DAO_Currency', | |
6a7e5e5d | 154 | 'localizable' => 0, |
c3fc2621 | 155 | 'html' => [ |
e501603b | 156 | 'type' => 'Text', |
c3fc2621 CW |
157 | ], |
158 | ], | |
159 | ]; | |
346aaaba | 160 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 161 | } |
346aaaba | 162 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 163 | } |
c3fc2621 | 164 | |
e501603b | 165 | /** |
bd8e0b14 | 166 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
167 | * |
168 | * @return array | |
bd8e0b14 | 169 | * Array(string $name => string $uniqueName). |
e501603b | 170 | */ |
c3fc2621 | 171 | public static function &fieldKeys() { |
bd8e0b14 TO |
172 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
173 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 174 | } |
bd8e0b14 | 175 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 176 | } |
c3fc2621 | 177 | |
e501603b TO |
178 | /** |
179 | * Returns the names of this table | |
180 | * | |
181 | * @return string | |
182 | */ | |
c3fc2621 | 183 | public static function getTableName() { |
e501603b TO |
184 | return self::$_tableName; |
185 | } | |
c3fc2621 | 186 | |
e501603b TO |
187 | /** |
188 | * Returns if this table needs to be logged | |
189 | * | |
c3fc2621 | 190 | * @return bool |
e501603b | 191 | */ |
c3fc2621 | 192 | public function getLog() { |
e501603b TO |
193 | return self::$_log; |
194 | } | |
c3fc2621 | 195 | |
e501603b TO |
196 | /** |
197 | * Returns the list of fields that can be imported | |
198 | * | |
199 | * @param bool $prefix | |
200 | * | |
201 | * @return array | |
202 | */ | |
c3fc2621 CW |
203 | public static function &import($prefix = FALSE) { |
204 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'currency', $prefix, []); | |
60808919 | 205 | return $r; |
e501603b | 206 | } |
c3fc2621 | 207 | |
e501603b TO |
208 | /** |
209 | * Returns the list of fields that can be exported | |
210 | * | |
211 | * @param bool $prefix | |
212 | * | |
213 | * @return array | |
214 | */ | |
c3fc2621 CW |
215 | public static function &export($prefix = FALSE) { |
216 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'currency', $prefix, []); | |
60808919 | 217 | return $r; |
e501603b | 218 | } |
c3fc2621 | 219 | |
e7a6b91a AS |
220 | /** |
221 | * Returns the list of indices | |
c3fc2621 CW |
222 | * |
223 | * @param bool $localize | |
224 | * | |
225 | * @return array | |
e7a6b91a AS |
226 | */ |
227 | public static function indices($localize = TRUE) { | |
c3fc2621 | 228 | $indices = []; |
e7a6b91a AS |
229 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
230 | } | |
c3fc2621 | 231 | |
e501603b | 232 | } |