| 1 | <?php |
||
| 15 | class BooleanFilter implements FilterInterface |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * {@inheritdoc} |
||
| 19 | */ |
||
| 20 | public function buildForm(FormBuilderInterface $builder, array $options) |
||
| 21 | { |
||
| 22 | $builder->add('value', ChoiceType::class, [ |
||
| 23 | 'choices' => [ |
||
| 24 | '' => 'any', |
||
| 25 | 1 => 'yes', |
||
| 26 | 0 => 'no', |
||
| 27 | ], |
||
| 28 | 'expanded' => true, |
||
| 29 | 'placeholder' => $options['placeholder'], |
||
| 30 | ]); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * {@inheritdoc} |
||
| 35 | */ |
||
| 36 | public function isApplicable(array $data): bool |
||
| 40 | |||
| 41 | /** |
||
| 42 | * {@inheritdoc} |
||
| 43 | */ |
||
| 44 | public function getExpression(string $fieldName, array $data): Expression |
||
| 52 | |||
| 53 | /** |
||
| 54 | * {@inheritdoc} |
||
| 55 | */ |
||
| 56 | public function configureOptions(OptionsResolver $options) |
||
| 60 | } |
||
| 61 |