1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Fhp\Model\StatementOfAccount; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Class Transaction |
7
|
|
|
* @package Fhp\Model\StatementOfAccount |
8
|
|
|
*/ |
9
|
|
|
class Transaction |
10
|
|
|
{ |
11
|
|
|
const CD_CREDIT = 'credit'; |
12
|
|
|
const CD_DEBIT = 'debit'; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* @var \DateTime|null |
16
|
|
|
*/ |
17
|
|
|
protected $bookingDate; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* @var \DateTime|null |
21
|
|
|
*/ |
22
|
|
|
protected $valutaDate; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @var float |
26
|
|
|
*/ |
27
|
|
|
protected $amount; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @var string |
31
|
|
|
*/ |
32
|
|
|
protected $creditDebit; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @var string |
36
|
|
|
*/ |
37
|
|
|
protected $bookingText; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @var string |
41
|
|
|
*/ |
42
|
|
|
protected $description1; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @var string |
46
|
|
|
*/ |
47
|
|
|
protected $description2; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* Array keys are identifiers like "SVWZ" for the main description. |
51
|
|
|
* @var array |
52
|
|
|
*/ |
53
|
|
|
protected $structuredDescription; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @var string |
57
|
|
|
*/ |
58
|
|
|
protected $bankCode; |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @var string |
62
|
|
|
*/ |
63
|
|
|
protected $accountNumber; |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @var string |
67
|
|
|
*/ |
68
|
|
|
protected $name; |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @var string |
72
|
|
|
*/ |
73
|
|
|
protected $satzart; |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* Get booking date. |
77
|
|
|
* |
78
|
|
|
* @deprecated Use getBookingDate() instead |
79
|
|
|
* @codeCoverageIgnore |
80
|
|
|
* @return \DateTime|null |
81
|
|
|
*/ |
82
|
|
|
public function getDate() |
83
|
|
|
{ |
84
|
|
|
return $this->getBookingDate(); |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* Get booking date |
89
|
|
|
* |
90
|
|
|
* @return \DateTime|null |
91
|
|
|
*/ |
92
|
1 |
|
public function getBookingDate() |
93
|
|
|
{ |
94
|
1 |
|
return $this->bookingDate; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* Get date |
99
|
|
|
* |
100
|
|
|
* @return \DateTime|null |
101
|
|
|
*/ |
102
|
1 |
|
public function getValutaDate() |
103
|
|
|
{ |
104
|
1 |
|
return $this->valutaDate; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* Set booking date |
109
|
|
|
* |
110
|
|
|
* @param \DateTime|null $date |
111
|
|
|
* |
112
|
|
|
* @return $this |
113
|
|
|
*/ |
114
|
1 |
|
public function setBookingDate(\DateTime $date = null) |
115
|
|
|
{ |
116
|
1 |
|
$this->bookingDate = $date; |
117
|
|
|
|
118
|
1 |
|
return $this; |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* Set valuta date |
123
|
|
|
* |
124
|
|
|
* @param \DateTime|null $date |
125
|
|
|
* |
126
|
|
|
* @return $this |
127
|
|
|
*/ |
128
|
1 |
|
public function setValutaDate(\DateTime $date = null) |
129
|
|
|
{ |
130
|
1 |
|
$this->valutaDate = $date; |
131
|
|
|
|
132
|
1 |
|
return $this; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* Get amount |
137
|
|
|
* |
138
|
|
|
* @return float |
139
|
|
|
*/ |
140
|
1 |
|
public function getAmount() |
141
|
|
|
{ |
142
|
1 |
|
return $this->amount; |
143
|
|
|
} |
144
|
|
|
|
145
|
|
|
/** |
146
|
|
|
* Set amount |
147
|
|
|
* |
148
|
|
|
* @param float $amount |
149
|
|
|
* |
150
|
|
|
* @return $this |
151
|
|
|
*/ |
152
|
1 |
|
public function setAmount($amount) |
153
|
|
|
{ |
154
|
1 |
|
$this->amount = (float) $amount; |
155
|
|
|
|
156
|
1 |
|
return $this; |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* Get creditDebit |
161
|
|
|
* |
162
|
|
|
* @return string |
163
|
|
|
*/ |
164
|
1 |
|
public function getCreditDebit() |
165
|
|
|
{ |
166
|
1 |
|
return $this->creditDebit; |
167
|
|
|
} |
168
|
|
|
|
169
|
|
|
/** |
170
|
|
|
* Set creditDebit |
171
|
|
|
* |
172
|
|
|
* @param string $creditDebit |
173
|
|
|
* |
174
|
|
|
* @return $this |
175
|
|
|
*/ |
176
|
1 |
|
public function setCreditDebit($creditDebit) |
177
|
|
|
{ |
178
|
1 |
|
$this->creditDebit = $creditDebit; |
179
|
|
|
|
180
|
1 |
|
return $this; |
181
|
|
|
} |
182
|
|
|
|
183
|
|
|
/** |
184
|
|
|
* Get bookingText |
185
|
|
|
* |
186
|
|
|
* @return string |
187
|
|
|
*/ |
188
|
1 |
|
public function getBookingText() |
189
|
|
|
{ |
190
|
1 |
|
return $this->bookingText; |
191
|
|
|
} |
192
|
|
|
|
193
|
|
|
/** |
194
|
|
|
* Set bookingText |
195
|
|
|
* |
196
|
|
|
* @param string $bookingText |
197
|
|
|
* |
198
|
|
|
* @return $this |
199
|
|
|
*/ |
200
|
1 |
|
public function setBookingText($bookingText) |
201
|
|
|
{ |
202
|
1 |
|
$this->bookingText = (string) $bookingText; |
203
|
|
|
|
204
|
1 |
|
return $this; |
205
|
|
|
} |
206
|
|
|
|
207
|
|
|
/** |
208
|
|
|
* Get description1 |
209
|
|
|
* |
210
|
|
|
* @return string |
211
|
|
|
*/ |
212
|
1 |
|
public function getDescription1() |
213
|
|
|
{ |
214
|
1 |
|
return $this->description1; |
215
|
|
|
} |
216
|
|
|
|
217
|
|
|
/** |
218
|
|
|
* Set description1 |
219
|
|
|
* |
220
|
|
|
* @param string $description1 |
221
|
|
|
* |
222
|
|
|
* @return $this |
223
|
|
|
*/ |
224
|
1 |
|
public function setDescription1($description1) |
225
|
|
|
{ |
226
|
1 |
|
$this->description1 = (string) $description1; |
227
|
|
|
|
228
|
1 |
|
return $this; |
229
|
|
|
} |
230
|
|
|
|
231
|
|
|
/** |
232
|
|
|
* Get description2 |
233
|
|
|
* |
234
|
|
|
* @return string |
235
|
|
|
*/ |
236
|
1 |
|
public function getDescription2() |
237
|
|
|
{ |
238
|
1 |
|
return $this->description2; |
239
|
|
|
} |
240
|
|
|
|
241
|
|
|
/** |
242
|
|
|
* Set description2 |
243
|
|
|
* |
244
|
|
|
* @param string $description2 |
245
|
|
|
* |
246
|
|
|
* @return $this |
247
|
|
|
*/ |
248
|
1 |
|
public function setDescription2($description2) |
249
|
|
|
{ |
250
|
1 |
|
$this->description2 = (string) $description2; |
251
|
|
|
|
252
|
1 |
|
return $this; |
253
|
|
|
} |
254
|
|
|
|
255
|
|
|
/** |
256
|
|
|
* Get structuredDescription |
257
|
|
|
* |
258
|
|
|
* @return array |
259
|
|
|
*/ |
260
|
|
|
public function getStructuredDescription() |
261
|
|
|
{ |
262
|
|
|
return $this->structuredDescription; |
263
|
|
|
} |
264
|
|
|
|
265
|
|
|
/** |
266
|
|
|
* Set structuredDescription |
267
|
|
|
* |
268
|
|
|
* @param array $structuredDescription |
269
|
|
|
* |
270
|
|
|
* @return $this |
271
|
|
|
*/ |
272
|
|
|
public function setStructuredDescription($structuredDescription) |
273
|
|
|
{ |
274
|
|
|
$this->structuredDescription = $structuredDescription; |
275
|
|
|
|
276
|
|
|
return $this; |
277
|
|
|
} |
278
|
|
|
|
279
|
|
|
/** |
280
|
|
|
* Get the main description (SVWZ) |
281
|
|
|
* |
282
|
|
|
* @return string |
283
|
|
|
*/ |
284
|
|
|
public function getMainDescription() |
285
|
|
|
{ |
286
|
|
|
if (array_key_exists('SVWZ', $this->structuredDescription)) { |
287
|
|
|
return $this->structuredDescription['SVWZ']; |
288
|
|
|
} else { |
289
|
|
|
return ""; |
290
|
|
|
} |
291
|
|
|
} |
292
|
|
|
|
293
|
|
|
/** |
294
|
|
|
* Get bankCode |
295
|
|
|
* |
296
|
|
|
* @return string |
297
|
|
|
*/ |
298
|
1 |
|
public function getBankCode() |
299
|
|
|
{ |
300
|
1 |
|
return $this->bankCode; |
301
|
|
|
} |
302
|
|
|
|
303
|
|
|
/** |
304
|
|
|
* Set bankCode |
305
|
|
|
* |
306
|
|
|
* @param string $bankCode |
307
|
|
|
* |
308
|
|
|
* @return $this |
309
|
|
|
*/ |
310
|
1 |
|
public function setBankCode($bankCode) |
311
|
|
|
{ |
312
|
1 |
|
$this->bankCode = (string) $bankCode; |
313
|
|
|
|
314
|
1 |
|
return $this; |
315
|
|
|
} |
316
|
|
|
|
317
|
|
|
/** |
318
|
|
|
* Get accountNumber |
319
|
|
|
* |
320
|
|
|
* @return string |
321
|
|
|
*/ |
322
|
1 |
|
public function getAccountNumber() |
323
|
|
|
{ |
324
|
1 |
|
return $this->accountNumber; |
325
|
|
|
} |
326
|
|
|
|
327
|
|
|
/** |
328
|
|
|
* Set accountNumber |
329
|
|
|
* |
330
|
|
|
* @param string $accountNumber |
331
|
|
|
* |
332
|
|
|
* @return $this |
333
|
|
|
*/ |
334
|
1 |
|
public function setAccountNumber($accountNumber) |
335
|
|
|
{ |
336
|
1 |
|
$this->accountNumber = (string) $accountNumber; |
337
|
|
|
|
338
|
1 |
|
return $this; |
339
|
|
|
} |
340
|
|
|
|
341
|
|
|
/** |
342
|
|
|
* Get name |
343
|
|
|
* |
344
|
|
|
* @return string |
345
|
|
|
*/ |
346
|
1 |
|
public function getName() |
347
|
|
|
{ |
348
|
1 |
|
return $this->name; |
349
|
|
|
} |
350
|
|
|
|
351
|
|
|
/** |
352
|
|
|
* Set name |
353
|
|
|
* |
354
|
|
|
* @param string $name |
355
|
|
|
* |
356
|
|
|
* @return $this |
357
|
|
|
*/ |
358
|
1 |
|
public function setName($name) |
359
|
|
|
{ |
360
|
1 |
|
$this->name = (string) $name; |
361
|
|
|
|
362
|
1 |
|
return $this; |
363
|
|
|
} |
364
|
|
|
|
365
|
|
|
/** |
366
|
|
|
* @return string |
367
|
|
|
*/ |
368
|
|
|
public function getSatzart() { |
369
|
|
|
return $this->satzart; |
370
|
|
|
} |
371
|
|
|
|
372
|
|
|
/** |
373
|
|
|
* @param string $satzart |
374
|
|
|
*/ |
375
|
|
|
public function setSatzart($satzart) { |
376
|
|
|
$this->satzart = $satzart; |
377
|
|
|
} |
378
|
|
|
|
379
|
|
|
} |
380
|
|
|
|