1 | <?php |
||
15 | class Property |
||
16 | { |
||
17 | /** |
||
18 | * @var mixed |
||
19 | */ |
||
20 | private $value; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private $label; |
||
26 | |||
27 | /** |
||
28 | * @param mixed $value |
||
29 | * @param string $label |
||
30 | * @param array|\FSi\Bundle\AdminBundle\Display\Property\ValueFormatter[] $valueFormatters |
||
31 | */ |
||
32 | public function __construct($value, $label, array $valueFormatters = []) |
||
40 | |||
41 | /** |
||
42 | * @return string |
||
43 | */ |
||
44 | public function getLabel() |
||
48 | |||
49 | /** |
||
50 | * @return mixed |
||
51 | */ |
||
52 | public function getValue() |
||
56 | |||
57 | /** |
||
58 | * @param mixed $value |
||
59 | * @param ValueFormatter[] $valueFormatters |
||
60 | * @return mixed |
||
61 | */ |
||
62 | private function formatValue($value, array $valueFormatters) |
||
70 | |||
71 | /** |
||
72 | * @param string $label |
||
73 | * @throws InvalidArgumentException |
||
74 | */ |
||
75 | private function validateLabel($label) |
||
84 | |||
85 | /** |
||
86 | * @param ValueFormatter[] $valueFormatters |
||
87 | * @throws InvalidArgumentException |
||
88 | */ |
||
89 | private function validateFormatters(array $valueFormatters) |
||
102 | } |
||
103 |