| @@ 10-28 (lines=19) @@ | ||
| 7 | use Psi\Component\Grid\View\Cell; |
|
| 8 | use Symfony\Component\OptionsResolver\OptionsResolver; |
|
| 9 | ||
| 10 | class SelectColumn extends AbstractColumn |
|
| 11 | { |
|
| 12 | const INPUT_NAME = '_select'; |
|
| 13 | ||
| 14 | public function buildCell(Cell $cell, array $options) |
|
| 15 | { |
|
| 16 | $cell->parameters['input_name'] = self::INPUT_NAME; |
|
| 17 | } |
|
| 18 | ||
| 19 | public function configureOptions(OptionsResolver $options) |
|
| 20 | { |
|
| 21 | $options->setDefault('property', 'id'); |
|
| 22 | } |
|
| 23 | ||
| 24 | public function getParent() |
|
| 25 | { |
|
| 26 | return PropertyColumn::class; |
|
| 27 | } |
|
| 28 | } |
|
| 29 | ||
| @@ 10-26 (lines=17) @@ | ||
| 7 | use Psi\Component\Grid\View\Cell; |
|
| 8 | use Symfony\Component\OptionsResolver\OptionsResolver; |
|
| 9 | ||
| 10 | class TextColumn extends AbstractColumn |
|
| 11 | { |
|
| 12 | public function buildCell(Cell $cell, array $options) |
|
| 13 | { |
|
| 14 | $cell->parameters['truncate'] = $options['truncate']; |
|
| 15 | } |
|
| 16 | ||
| 17 | public function configureOptions(OptionsResolver $options) |
|
| 18 | { |
|
| 19 | $options->setDefault('truncate', null); |
|
| 20 | } |
|
| 21 | ||
| 22 | public function getParent() |
|
| 23 | { |
|
| 24 | return PropertyColumn::class; |
|
| 25 | } |
|
| 26 | } |
|
| 27 | ||