Skip to content

Commit

Permalink
Fix ChoiceFilter operator type
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu committed Jun 8, 2022
1 parent 48b9e13 commit b9abba4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Filter/ChoiceFilter.php
Expand Up @@ -14,22 +14,26 @@
namespace Sonata\DoctrineMongoDBAdminBundle\Filter;

use Sonata\AdminBundle\Filter\Model\FilterData;
use Sonata\AdminBundle\Form\Type\Filter\ChoiceType;
use Sonata\AdminBundle\Form\Type\Filter\DefaultType;
use Sonata\AdminBundle\Form\Type\Operator\ContainsOperatorType;
use Sonata\AdminBundle\Form\Type\Operator\EqualOperatorType;
use Sonata\DoctrineMongoDBAdminBundle\Datagrid\ProxyQueryInterface;

final class ChoiceFilter extends Filter
{
public function getDefaultOptions(): array
{
return [];
return [
'operator_type' => EqualOperatorType::class,
'operator_options' => [],
];
}

public function getRenderSettings(): array
{
return [DefaultType::class, [
'operator_type' => ChoiceType::class,
'operator_type' => $this->getOption('operator_type'),
'operator_options' => $this->getOption('operator_options'),
'field_type' => $this->getFieldType(),
'field_options' => $this->getFieldOptions(),
'label' => $this->getLabel(),
Expand Down

0 comments on commit b9abba4

Please sign in to comment.