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