Skip to content

Commit

Permalink
Allow to pass extra field options
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Apr 13, 2024
1 parent 143fbb1 commit 214230a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Filter/ClassFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public function getDefaultOptions(): array
{
return [
'field_type' => ChoiceType::class,
'field_options' => [],
'operator_type' => EqualOperatorType::class,
'operator_options' => [],
];
Expand All @@ -57,10 +58,13 @@ public function getFormOptions(): array
{
return [
'field_type' => $this->getFieldType(),
'field_options' => [
'required' => false,
'choices' => $this->getOption('sub_classes'),
],
'field_options' => array_merge(
[
'required' => false,
'choices' => $this->getOption('sub_classes'),
],
$this->getFieldOptions(),
),
'operator_type' => $this->getOption('operator_type'),
'operator_options' => $this->getOption('operator_options'),
'label' => $this->getLabel(),
Expand Down

0 comments on commit 214230a

Please sign in to comment.