Total Complexity | 13 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
8 | class RelationColumn extends DataColumn |
||
9 | { |
||
10 | protected $labelAttribute; |
||
11 | |||
12 | protected function checkConfiguration() |
||
17 | } |
||
18 | } |
||
19 | |||
20 | /** |
||
21 | * @return string |
||
22 | */ |
||
23 | public function getLabel(): string |
||
28 | } |
||
29 | |||
30 | |||
31 | public function getCellContent($entity) |
||
32 | { |
||
33 | $obj = $this->getCellValue($entity); |
||
34 | if (is_object($obj)) { |
||
35 | $result = $obj->{'get' . ucfirst($this->labelAttribute)}(); |
||
36 | return $this->format === 'html' |
||
37 | ? $result |
||
38 | : htmlspecialchars($result); |
||
39 | } |
||
40 | return is_string($obj) ? (empty($obj) ? $this->emptyValue : $obj) : $this->emptyValue; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @return mixed |
||
45 | */ |
||
46 | public function getLabelAttribute() |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * @param string $labelAttribute |
||
53 | */ |
||
54 | protected function setLabelAttribute(string $labelAttribute): void |
||
57 | } |
||
58 | } |
||
59 |