| Total Complexity | 11 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class RelationColumn extends DataColumn |
||
| 9 | { |
||
| 10 | protected $labelAttribute; |
||
| 11 | |||
| 12 | protected function checkConfiguration() |
||
| 13 | { |
||
| 14 | parent::checkConfiguration(); |
||
| 15 | if (!is_string($this->labelAttribute) || empty($this->labelAttribute)) { |
||
| 16 | $this->labelAttribute = 'id'; |
||
| 17 | } |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @return string |
||
| 22 | */ |
||
| 23 | public function getLabel(): string |
||
| 24 | { |
||
| 25 | return !empty($this->label) ? $this->label : "{$this->attribute}.{$this->labelAttribute}"; |
||
| 26 | } |
||
| 27 | |||
| 28 | |||
| 29 | public function getCellContent($entity) |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @return mixed |
||
| 43 | */ |
||
| 44 | public function getLabelAttribute() |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @param string $labelAttribute |
||
| 51 | */ |
||
| 52 | protected function setLabelAttribute(string $labelAttribute): void |
||
| 55 | } |
||
| 56 | } |
||
| 57 |