Commit | Line | Data |
---|---|---|
e501603b TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
4 | | CiviCRM version 4.7 | | |
5 | +--------------------------------------------------------------------+ | |
6 | | Copyright CiviCRM LLC (c) 2004-2016 | | |
7 | +--------------------------------------------------------------------+ | |
8 | | This file is a part of CiviCRM. | | |
9 | | | | |
10 | | CiviCRM is free software; you can copy, modify, and distribute it | | |
11 | | under the terms of the GNU Affero General Public License | | |
12 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | |
13 | | | | |
14 | | CiviCRM is distributed in the hope that it will be useful, but | | |
15 | | WITHOUT ANY WARRANTY; without even the implied warranty of | | |
16 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | |
17 | | See the GNU Affero General Public License for more details. | | |
18 | | | | |
19 | | You should have received a copy of the GNU Affero General Public | | |
20 | | License and the CiviCRM Licensing Exception along | | |
21 | | with this program; if not, contact CiviCRM LLC | | |
22 | | at info[AT]civicrm[DOT]org. If you have questions about the | | |
23 | | GNU Affero General Public License or the licensing of CiviCRM, | | |
24 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | | |
25 | +--------------------------------------------------------------------+ | |
26 | */ | |
27 | /** | |
28 | * @package CRM | |
29 | * @copyright CiviCRM LLC (c) 2004-2016 | |
30 | * | |
31 | * Generated from xml/schema/CRM/Financial/Currency.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
437fafcf | 33 | * (GenCodeChecksum:deabd1e34379cc8d360e65777d1d4c9b) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
37 | class CRM_Financial_DAO_Currency extends CRM_Core_DAO { | |
38 | /** | |
39 | * static instance to hold the table name | |
40 | * | |
41 | * @var string | |
42 | */ | |
43 | static $_tableName = 'civicrm_currency'; | |
e501603b TO |
44 | /** |
45 | * static value to see if we should log any modifications to | |
46 | * this table in the civicrm_log table | |
47 | * | |
48 | * @var boolean | |
49 | */ | |
50 | static $_log = true; | |
51 | /** | |
52 | * Currency Id | |
53 | * | |
54 | * @var int unsigned | |
55 | */ | |
56 | public $id; | |
57 | /** | |
58 | * Currency Name | |
59 | * | |
60 | * @var string | |
61 | */ | |
62 | public $name; | |
63 | /** | |
64 | * Currency Symbol | |
65 | * | |
66 | * @var string | |
67 | */ | |
68 | public $symbol; | |
69 | /** | |
70 | * Numeric currency code | |
71 | * | |
72 | * @var string | |
73 | */ | |
74 | public $numeric_code; | |
75 | /** | |
76 | * Full currency name | |
77 | * | |
78 | * @var string | |
79 | */ | |
80 | public $full_name; | |
81 | /** | |
82 | * class constructor | |
83 | * | |
84 | * @return civicrm_currency | |
85 | */ | |
86 | function __construct() { | |
87 | $this->__table = 'civicrm_currency'; | |
88 | parent::__construct(); | |
89 | } | |
90 | /** | |
91 | * Returns all the column names of this table | |
92 | * | |
93 | * @return array | |
94 | */ | |
95 | static function &fields() { | |
346aaaba TO |
96 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
97 | Civi::$statics[__CLASS__]['fields'] = array( | |
e501603b TO |
98 | 'id' => array( |
99 | 'name' => 'id', | |
100 | 'type' => CRM_Utils_Type::T_INT, | |
101 | 'title' => ts('Currency ID') , | |
102 | 'description' => 'Currency Id', | |
103 | 'required' => true, | |
104 | ) , | |
105 | 'name' => array( | |
106 | 'name' => 'name', | |
107 | 'type' => CRM_Utils_Type::T_STRING, | |
108 | 'title' => ts('Currency') , | |
109 | 'description' => 'Currency Name', | |
110 | 'maxlength' => 64, | |
111 | 'size' => CRM_Utils_Type::BIG, | |
112 | 'import' => true, | |
113 | 'where' => 'civicrm_currency.name', | |
114 | 'headerPattern' => '', | |
115 | 'dataPattern' => '', | |
116 | 'export' => true, | |
117 | 'html' => array( | |
118 | 'type' => 'Text', | |
119 | ) , | |
120 | ) , | |
121 | 'symbol' => array( | |
122 | 'name' => 'symbol', | |
123 | 'type' => CRM_Utils_Type::T_STRING, | |
124 | 'title' => ts('Currency Symbol') , | |
125 | 'description' => 'Currency Symbol', | |
126 | 'maxlength' => 8, | |
127 | 'size' => CRM_Utils_Type::EIGHT, | |
128 | 'html' => array( | |
129 | 'type' => 'Text', | |
130 | ) , | |
131 | ) , | |
132 | 'numeric_code' => array( | |
133 | 'name' => 'numeric_code', | |
134 | 'type' => CRM_Utils_Type::T_STRING, | |
135 | 'title' => ts('Currency Numeric Code') , | |
136 | 'description' => 'Numeric currency code', | |
137 | 'maxlength' => 3, | |
138 | 'size' => CRM_Utils_Type::FOUR, | |
139 | 'import' => true, | |
140 | 'where' => 'civicrm_currency.numeric_code', | |
141 | 'headerPattern' => '', | |
142 | 'dataPattern' => '', | |
143 | 'export' => true, | |
144 | ) , | |
145 | 'full_name' => array( | |
146 | 'name' => 'full_name', | |
147 | 'type' => CRM_Utils_Type::T_STRING, | |
148 | 'title' => ts('Full Currency Name') , | |
149 | 'description' => 'Full currency name', | |
150 | 'maxlength' => 64, | |
151 | 'size' => CRM_Utils_Type::BIG, | |
152 | 'html' => array( | |
153 | 'type' => 'Text', | |
154 | ) , | |
155 | ) , | |
156 | ); | |
346aaaba | 157 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 158 | } |
346aaaba | 159 | return Civi::$statics[__CLASS__]['fields']; |
e501603b TO |
160 | } |
161 | /** | |
bd8e0b14 | 162 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
163 | * |
164 | * @return array | |
bd8e0b14 | 165 | * Array(string $name => string $uniqueName). |
e501603b TO |
166 | */ |
167 | static function &fieldKeys() { | |
bd8e0b14 TO |
168 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
169 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 170 | } |
bd8e0b14 | 171 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b TO |
172 | } |
173 | /** | |
174 | * Returns the names of this table | |
175 | * | |
176 | * @return string | |
177 | */ | |
178 | static function getTableName() { | |
179 | return self::$_tableName; | |
180 | } | |
181 | /** | |
182 | * Returns if this table needs to be logged | |
183 | * | |
184 | * @return boolean | |
185 | */ | |
186 | function getLog() { | |
187 | return self::$_log; | |
188 | } | |
189 | /** | |
190 | * Returns the list of fields that can be imported | |
191 | * | |
192 | * @param bool $prefix | |
193 | * | |
194 | * @return array | |
195 | */ | |
196 | static function &import($prefix = false) { | |
60808919 TO |
197 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'currency', $prefix, array()); |
198 | return $r; | |
e501603b TO |
199 | } |
200 | /** | |
201 | * Returns the list of fields that can be exported | |
202 | * | |
203 | * @param bool $prefix | |
204 | * | |
205 | * @return array | |
206 | */ | |
207 | static function &export($prefix = false) { | |
60808919 TO |
208 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'currency', $prefix, array()); |
209 | return $r; | |
e501603b TO |
210 | } |
211 | } |