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