| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | namespace Atk4\Ui\Table\Column; |
| 6: | |
| 7: | use Atk4\Data\Field; |
| 8: | use Atk4\Data\Model; |
| 9: | use Atk4\Ui\Table; |
| 10: | |
| 11: | |
| 12: | |
| 13: | |
| 14: | |
| 15: | |
| 16: | |
| 17: | |
| 18: | |
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | |
| 25: | class NoValue extends Table\Column |
| 26: | { |
| 27: | |
| 28: | public $noValue = ' --- '; |
| 29: | |
| 30: | #[\Override] |
| 31: | public function getHtmlTags(Model $row, ?Field $field): array |
| 32: | { |
| 33: | $actualValue = $field->get($row); |
| 34: | |
| 35: | if ($actualValue === null || $actualValue === '') { |
| 36: | return [$field->shortName => $this->noValue]; |
| 37: | } |
| 38: | |
| 39: | return parent::getHtmlTags($row, $field); |
| 40: | } |
| 41: | } |
| 42: | |