1 | <?php |
||
11 | class Transaction implements \JsonSerializable |
||
12 | { |
||
13 | const DEBIT = 'D'; |
||
14 | const CREDIT = 'C'; |
||
15 | |||
16 | private $account = ''; |
||
17 | private $accountName = ''; |
||
18 | private $price = 0.0; |
||
19 | private $debitcredit = ''; |
||
20 | private $cancellation = false; |
||
21 | private $description = ''; |
||
22 | private $valueTimestamp = 0; |
||
23 | private $entryTimestamp = 0; |
||
24 | private $transactionCode = ''; |
||
25 | |||
26 | /** |
||
27 | * @return array |
||
28 | */ |
||
29 | public function jsonSerialize() |
||
33 | |||
34 | /** |
||
35 | * @param string $var |
||
36 | */ |
||
37 | public function setAccount($var) |
||
41 | |||
42 | /** |
||
43 | * @param string $var |
||
44 | */ |
||
45 | public function setAccountName($var) |
||
49 | |||
50 | /** |
||
51 | * @param float $var |
||
52 | */ |
||
53 | public function setPrice($var) |
||
57 | |||
58 | /** |
||
59 | * @param string $var |
||
60 | */ |
||
61 | public function setDebitCredit($var) |
||
65 | |||
66 | /** |
||
67 | * @param bool $var |
||
68 | */ |
||
69 | public function setCancellation($var) |
||
73 | |||
74 | /** |
||
75 | * @param string $var |
||
76 | */ |
||
77 | public function setDescription($var) |
||
81 | |||
82 | /** |
||
83 | * @param int $var |
||
84 | */ |
||
85 | public function setValueTimestamp($var) |
||
89 | |||
90 | /** |
||
91 | * @param int $var |
||
92 | */ |
||
93 | public function setEntryTimestamp($var) |
||
97 | |||
98 | /** |
||
99 | * @param string $var |
||
100 | */ |
||
101 | public function setTransactionCode($var) |
||
105 | |||
106 | // getters |
||
107 | /** |
||
108 | * @return string |
||
109 | */ |
||
110 | public function getAccount() |
||
114 | |||
115 | /** |
||
116 | * @return string |
||
117 | */ |
||
118 | public function getAccountName() |
||
122 | |||
123 | /** |
||
124 | * @return float |
||
125 | */ |
||
126 | public function getPrice() |
||
130 | |||
131 | /** |
||
132 | * @return string |
||
133 | */ |
||
134 | public function getDebitCredit() |
||
138 | |||
139 | /** |
||
140 | * @return string |
||
141 | */ |
||
142 | public function getDescription() |
||
146 | |||
147 | /** |
||
148 | * @param string $format |
||
149 | * |
||
150 | * @return string |
||
151 | */ |
||
152 | public function getValueTimestamp($format = 'U') |
||
156 | |||
157 | /** |
||
158 | * @param string $format |
||
159 | * |
||
160 | * @return string |
||
161 | */ |
||
162 | public function getEntryTimestamp($format = 'U') |
||
166 | |||
167 | /** |
||
168 | * @return string |
||
169 | */ |
||
170 | public function getTransactionCode() |
||
174 | |||
175 | /** |
||
176 | * @return bool |
||
177 | */ |
||
178 | public function isDebit() |
||
182 | |||
183 | /** |
||
184 | * @return bool |
||
185 | */ |
||
186 | public function isCredit() |
||
190 | |||
191 | /** |
||
192 | * @return bool |
||
193 | */ |
||
194 | public function isCancellation() |
||
198 | } |
||
199 |