| 1 | <?php |
||
| 12 | class Column { |
||
| 13 | |||
| 14 | /** @var string */ |
||
| 15 | private $_name; |
||
| 16 | |||
| 17 | /** @var Relation */ |
||
| 18 | private $_relation; |
||
| 19 | |||
| 20 | /** @var ColumnFormatter */ |
||
| 21 | private $_formatter; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Column constructor. |
||
| 25 | * @param string $name |
||
| 26 | * @param ColumnFormatter|null $columnFormatter |
||
| 27 | */ |
||
| 28 | 38 | public function __construct(string $name, ? ColumnFormatter $columnFormatter = null) |
|
| 33 | |||
| 34 | /** |
||
| 35 | * @return string |
||
| 36 | */ |
||
| 37 | 31 | public function getName(): string |
|
| 41 | |||
| 42 | /** |
||
| 43 | * @param string $name |
||
| 44 | */ |
||
| 45 | 38 | public function setName(string $name) |
|
| 58 | |||
| 59 | /** |
||
| 60 | * @return null|Relation |
||
| 61 | */ |
||
| 62 | 31 | public function getRelation(): ?Relation |
|
| 66 | |||
| 67 | /** |
||
| 68 | * @param ColumnFormatter $columnFormatter |
||
| 69 | * @return Column |
||
| 70 | */ |
||
| 71 | 2 | public function setFormatter(ColumnFormatter $columnFormatter): Column |
|
| 77 | |||
| 78 | /** |
||
| 79 | * Formats the column data. |
||
| 80 | * |
||
| 81 | * @param string $data |
||
| 82 | * @return string |
||
| 83 | */ |
||
| 84 | public function format(string $data): string |
||
| 88 | } |