1 | <?php |
||
13 | class Column { |
||
14 | |||
15 | /** @var string */ |
||
16 | private $_key; |
||
17 | |||
18 | /** @var string */ |
||
19 | private $_name; |
||
20 | |||
21 | /** @var bool */ |
||
22 | private $_mutated = false; |
||
23 | |||
24 | /** @var string */ |
||
25 | private $_table; |
||
26 | |||
27 | /** @var ColumnRelation */ |
||
28 | private $_relation; |
||
29 | |||
30 | /** @var ColumnFormatter */ |
||
31 | private $_formatter; |
||
32 | |||
33 | /** |
||
34 | * Column constructor. |
||
35 | * @param string $name |
||
36 | * @param ColumnFormatter|null $columnFormatter |
||
37 | * @param Model|null $sourceModel |
||
38 | */ |
||
39 | 49 | public function __construct(string $name, ? ColumnFormatter $columnFormatter = null, ? Model $sourceModel = null) |
|
49 | |||
50 | /** |
||
51 | * @param string $name |
||
52 | */ |
||
53 | 49 | private function _setName(string $name) : void |
|
69 | |||
70 | /** |
||
71 | * @return string |
||
72 | */ |
||
73 | 5 | public function getName() : string |
|
77 | |||
78 | /** |
||
79 | * @return bool |
||
80 | */ |
||
81 | 36 | public function isMutated() : bool |
|
85 | |||
86 | /** |
||
87 | * @return null|ColumnRelation |
||
88 | */ |
||
89 | 3 | public function getRelation() : ? ColumnRelation |
|
93 | |||
94 | /** |
||
95 | * @param ColumnFormatter $columnFormatter |
||
96 | * @return Column |
||
97 | */ |
||
98 | 2 | public function setFormatter(ColumnFormatter $columnFormatter) : Column |
|
104 | |||
105 | /** |
||
106 | * Get the formatted column value. |
||
107 | * |
||
108 | * @param Model $rowModel |
||
109 | * @return string|null |
||
110 | */ |
||
111 | 34 | public function getFormattedValue(Model $rowModel) : ? string |
|
117 | |||
118 | /** |
||
119 | * Get the value of this column for the given row. |
||
120 | * |
||
121 | * @param Model $rowModel |
||
122 | * @return string|null |
||
123 | */ |
||
124 | 34 | public function getValue(Model $rowModel) : ? string |
|
128 | |||
129 | /** |
||
130 | * @return string |
||
131 | */ |
||
132 | 34 | public function getKey() : string |
|
136 | |||
137 | /** |
||
138 | * @return string |
||
139 | */ |
||
140 | 34 | public function getIdentifier() : string |
|
144 | |||
145 | /** |
||
146 | * @return string |
||
147 | */ |
||
148 | 35 | public function getAttributeName() : string |
|
162 | } |
||
163 |