Resolves #60725: Reduce used memory of the Domain Models (Thanks to Tim Lochm├╝ller)
[TYPO3CMS/Extensions/static_info_tables.git] / Classes / Domain / Model / Currency.php
1 <?php
2 namespace SJBR\StaticInfoTables\Domain\Model;
3 /***************************************************************
4 * Copyright notice
5 *
6 * (c) 2011-2012 Armin R├╝diger Vieweg <info@professorweb.de>
7 * (c) 2013-2014 Stanislas Rolland <typo3(arobas)sjbr.ca>
8 *
9 * All rights reserved
10 *
11 * This script is part of the TYPO3 project. The TYPO3 project is
12 * free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * The GNU General Public License can be found at
18 * http://www.gnu.org/copyleft/gpl.html.
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27 /**
28 * The Currency model
29 *
30 * @copyright Copyright belongs to the respective authors
31 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
32 */
33
34 use SJBR\StaticInfoTables\Utility\ModelUtility;
35
36 class Currency extends AbstractEntity {
37
38 /**
39 * The number of decimals to be shown when an amount is presented in this currency
40 * @var integer
41 */
42 protected $decimalDigits = 0;
43
44 /**
45 * The character to be shown in front of the decimals when an amount is presented in this currency
46 * @var string
47 */
48 protected $decimalPoint = '';
49
50 /**
51 * Deletion status of the object
52 * @var boolean
53 */
54 protected $deleted = FALSE;
55
56 /**
57 * The divisor used to obtain the subdivision of the currency
58 * @var integer
59 */
60 protected $divisor = 0;
61
62 /**
63 * Currency code as three digit string (i.e. EUR)
64 * ISO 4217 alpha-3 currency code
65 * @var string
66 */
67 protected $isoCodeA3 = '';
68
69 /**
70 * Currency code as number
71 * ISO 4217 numeric currency code
72 * @var integer
73 */
74 protected $isoCodeNumber = 0;
75
76 /**
77 * English name of the currency
78 * @var string
79 */
80 protected $nameEn = '';
81
82 /**
83 * English name of the currency subdivision unit
84 * @var string
85 */
86 protected $subdivisionNameEn = '';
87
88 /**
89 * The symbol to be shown to the left of an amount stated in units of the subdivision of the currency
90 * @var string
91 */
92 protected $subdivisionSymbolLeft = '';
93
94 /**
95 * The symbol to be shown to the right of an amount stated in units of the subdivision of the currency
96 * @var string
97 */
98 protected $subdivisionSymbolRight = '';
99
100 /**
101 * The symbol to be shown to the left of an amount stated in units of the currency
102 * @var string
103 */
104 protected $symbolLeft = '';
105
106 /**
107 * The symbol to be shown to the right of an amount stated in units of the currency
108 * @var string
109 */
110 protected $symbolRight = '';
111
112 /**
113 * Character to be used between every group of thousands of an amount stated in units of this currency
114 * @var string
115 */
116 protected $thousandsPoint = '';
117
118 /**
119 * On initialization, get the columns mapping configuration
120 */
121 public function initializeObject() {
122 parent::initializeObject();
123 $this->tableName = ModelUtility::getModelMapping('SJBR\\StaticInfoTables\\Domain\\Model\\Currency', ModelUtility::MAPPING_TABLENAME);
124 $this->columnsMapping = ModelUtility::getModelMapping('SJBR\\StaticInfoTables\\Domain\\Model\\Currency', ModelUtility::MAPPING_COLUMNS);
125 }
126
127 /**
128 * Sets the number of decimal digits.
129 *
130 * @param integer $decimalDigits
131 *
132 * @return void
133 */
134 public function setDecimalDigits($decimalDigits) {
135 $this->decimalDigits = $decimalDigits;
136 }
137
138 /**
139 * Gets the number of decimal digits.
140 *
141 * @return integer
142 */
143 public function getDecimalDigits() {
144 return $this->decimalDigits;
145 }
146
147 /**
148 * Sets the decimal point character
149 *
150 * @param string $decimalPoint
151 *
152 * @return void
153 */
154 public function setDecimalPoint($decimalPoint) {
155 $this->decimalPoint = $decimalPoint;
156 }
157
158 /**
159 * Gets the decimal point character
160 *
161 * @return string
162 */
163 public function getDecimalPoint() {
164 return $this->decimalPoint;
165 }
166
167 /**
168 * Gets the deletion status of the entity
169 *
170 * @return boolean
171 */
172 public function getDeleted() {
173 return $this->deleted;
174 }
175
176 /**
177 * Sets the deletion status of the entity
178 *
179 * @param boolean $deleted
180 * @return void
181 */
182 public function setDeleted($deleted) {
183 return $this->deleted = $deleted;
184 }
185
186 /**
187 * Sets the divisor.
188 *
189 * @param integer $divisor
190 *
191 * @return void
192 */
193 public function setDivisor($divisor) {
194 $this->divisor = $divisor;
195 }
196
197 /**
198 * Gets the divisor.
199 *
200 * @return integer
201 */
202 public function getDivisor() {
203 return $this->divisor;
204 }
205
206 /**
207 * Sets the ISO alpha-3 code.
208 *
209 * @param string $isoCodeA3
210 *
211 * @return void
212 */
213 public function setIsoCodeA3($isoCodeA3) {
214 $this->isoCodeA3 = $isoCodeA3;
215 }
216
217 /**
218 * Gets the ISO alpha-3 code.
219 *
220 * @return string
221 */
222 public function getIsoCodeA3() {
223 return $this->isoCodeA3;
224 }
225
226 /**
227 * Sets the ISO code number.
228 *
229 * @param integer $isoCodeNumber
230 *
231 * @return void
232 */
233 public function setIsoCodeNumber($isoCodeNumber) {
234 $this->isoCodeNumber = $isoCodeNumber;
235 }
236
237 /**
238 * Gets the ISO code number.
239 *
240 * @return integer
241 */
242 public function getIsoCodeNumber() {
243 return $this->isoCodeNumber;
244 }
245
246 /**
247 * Sets the English name of the currency
248 *
249 * @param string $nameEn
250 *
251 * @return void
252 */
253 public function setNameEn($nameEn) {
254 $this->nameEn = $nameEn;
255 }
256
257 /**
258 * Gets the English name of the currency
259 *
260 * @return string
261 */
262 public function getNameEn() {
263 return $this->nameEn;
264 }
265
266 /**
267 * Sets the English name of the currency subdivision
268 *
269 * @param string $subdivisionNameEn
270 *
271 * @return void
272 */
273 public function setSubdivisionNameEn($subdivisionNameEn) {
274 $this->subdivisionNameEn = $subdivisionNameEn;
275 }
276
277 /**
278 * Gets the English name of the currency subdivision
279 *
280 * @return string
281 */
282 public function getSubdivisionNameEn() {
283 return $this->subdivisionNameEn;
284 }
285
286 /**
287 * Sets the left-hand side symbol for an amount stated in units of the subdivision of the currency
288 *
289 * @param string $subdivisionSymbolLeft
290 *
291 * @return void
292 */
293 public function setSubdivisionSymbolLeft($subdivisionSymbolLeft) {
294 $this->subdivisionSymbolLeft = $subdivisionSymbolLeft;
295 }
296
297 /**
298 * Gets the left-hand side symbol for an amount stated in units of the subdivision of the currency
299 *
300 * @return string
301 */
302 public function getSubdivisionSymbolLeft() {
303 return $this->subdivisionSymbolLeft;
304 }
305
306 /**
307 * Sets the right-hand side symbol for an amount stated in units of the subdivision of the currency
308 *
309 * @param string $subdivisionSymbolRight
310 *
311 * @return void
312 */
313 public function setSubdivisionSymbolRight($subdivisionSymbolRight) {
314 $this->subdivisionSymbolRight = $subdivisionSymbolRight;
315 }
316
317 /**
318 * Gets the right-hand side symbol for an amount stated in units of the subdivision of the currency
319 *
320 * @return string
321 */
322 public function getSubdivisionSymbolRight() {
323 return $this->subdivisionSymbolRight;
324 }
325
326 /**
327 * Sets the symbol to be shown to the left of an amount stated in units of the currency
328 *
329 * @param string $symbolLeft
330 *
331 * @return void
332 */
333 public function setSymbolLeft($symbolLeft) {
334 $this->symbolLeft = $symbolLeft;
335 }
336
337 /**
338 * Gets the symbol to be shown to the left of an amount stated in units of the currency
339 *
340 * @return string
341 */
342 public function getSymbolLeft() {
343 return $this->symbolLeft;
344 }
345
346 /**
347 * Sets the symbol to be shown to the right of an amount stated in units of the currency
348 *
349 * @param string $symbolRight
350 *
351 * @return void
352 */
353 public function setSymbolRight($symbolRight) {
354 $this->symbolRight = $symbolRight;
355 }
356
357 /**
358 * Gets the symbol to be shown to the right of an amount stated in units of the currency
359 *
360 * @return string
361 */
362 public function getSymbolRight() {
363 return $this->symbolRight;
364 }
365
366 /**
367 * Sets the thousands point/separator.
368 *
369 * @param string $thousandsPoint
370 *
371 * @return void
372 */
373 public function setThousandsPoint($thousandsPoint) {
374 $this->thousandsPoint = $thousandsPoint;
375 }
376
377 /**
378 * Gets the thousands point/separator.
379 *
380 * @return string
381 */
382 public function getThousandsPoint() {
383 return $this->thousandsPoint;
384 }
385 }