1 | <?php |
||
14 | class Mapping |
||
15 | { |
||
16 | /** @var float */ |
||
17 | private $mod; |
||
18 | |||
19 | /** @var float */ |
||
20 | private $ifMoreThan; |
||
21 | |||
22 | /** @var string */ |
||
23 | private $unit; |
||
24 | |||
25 | /** @var UnitInterface|null */ |
||
26 | private $unitClass = null; |
||
27 | |||
28 | /** |
||
29 | * Mapping constructor. |
||
30 | * |
||
31 | * @param array<string,float|string> $data |
||
32 | */ |
||
33 | 17 | public function __construct(array $data) |
|
39 | |||
40 | /** |
||
41 | * @return float |
||
42 | */ |
||
43 | 12 | public function getMod(): float |
|
47 | |||
48 | /** |
||
49 | * @param float $mod |
||
50 | * |
||
51 | * @return $this |
||
52 | */ |
||
53 | 1 | public function setMod(float $mod): self |
|
54 | { |
||
55 | 1 | $this->mod = $mod; |
|
56 | |||
57 | 1 | return $this; |
|
58 | } |
||
59 | |||
60 | /** |
||
61 | * @return float |
||
62 | */ |
||
63 | 14 | public function getIfMoreThan(): float |
|
67 | |||
68 | /** |
||
69 | * @param float $ifMoreThan |
||
70 | * |
||
71 | * @return $this |
||
72 | */ |
||
73 | 1 | public function setIfMoreThan(float $ifMoreThan): self |
|
79 | |||
80 | /** |
||
81 | * @return string |
||
82 | */ |
||
83 | 2 | public function getUnit(): string |
|
87 | |||
88 | /** |
||
89 | * @return UnitInterface |
||
90 | */ |
||
91 | 15 | public function getUnitClass(): UnitInterface |
|
114 | |||
115 | /** |
||
116 | * @param string $unit |
||
117 | * |
||
118 | * @return $this |
||
119 | */ |
||
120 | 1 | public function setUnit(string $unit): self |
|
126 | } |
||
127 |