Total Complexity | 13 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Coverage | 94.44% |
Changes | 0 |
1 | <?php |
||
18 | class Price extends Simple |
||
19 | { |
||
20 | protected $type; |
||
21 | |||
22 | 1 | public function __get($name) |
|
23 | { |
||
24 | 1 | if ($result = parent::__get($name)) { |
|
25 | 1 | if ($this->type && ($value = $this->type->{$name})) { |
|
26 | return $value; |
||
27 | } |
||
28 | } |
||
29 | 1 | return $result; |
|
30 | } |
||
31 | |||
32 | 1 | public function propertyAliases() |
|
33 | { |
||
34 | return [ |
||
35 | 1 | 'Представление' => 'performance', |
|
36 | 'ИдТипаЦены' => 'id', |
||
37 | 'ЦенаЗаЕдиницу' => 'cost', |
||
38 | 'Валюта' => 'currency', |
||
39 | 'Единица' => 'unit', |
||
40 | 'Коэффициент' => 'rate', |
||
41 | ]; |
||
42 | } |
||
43 | |||
44 | 1 | public function getType() |
|
52 | } |
||
53 | |||
54 | 1 | public function init() |
|
63 | } |
||
64 | } |