Total Complexity | 3 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
14 | trait HasAutomaticBalance |
||
15 | { |
||
16 | #[ORM\Column(type: 'CHF', options: ['default' => 0])] |
||
17 | private Money $balanceCHF; |
||
18 | |||
19 | #[ORM\Column(type: 'EUR', options: ['default' => 0])] |
||
20 | private Money $balanceEUR; |
||
21 | |||
22 | /** |
||
23 | * Get total balance. |
||
24 | * |
||
25 | * Read only, computed by SQL triggers |
||
26 | */ |
||
27 | 9 | #[API\Field(type: CHFType::class)] |
|
31 | } |
||
32 | |||
33 | /** |
||
34 | * Get total balance. |
||
35 | * |
||
36 | * Read only, computed by SQL triggers |
||
37 | */ |
||
38 | 7 | #[API\Field(type: EURType::class)] |
|
39 | public function getBalanceEUR(): Money |
||
40 | { |
||
41 | 7 | return $this->balanceEUR; |
|
42 | } |
||
43 | |||
44 | /** |
||
45 | * Returns the non-zero balance formatted as string. |
||
46 | */ |
||
47 | 9 | public function getFormattedBalance(): string |
|
50 | } |
||
51 | } |
||
52 |