Event/Listener/PrepareListener.php
public function onFilterBuilderPrepare(PrepareEvent $event)
    {
        $qb = $event->getQueryBuilder();

        $queryClasses = array(
            'Doctrine\ORM\QueryBuilder'          => 'Lexik\Bundle\FormFilterBundle\Filter\Doctrine\ORMQuery',
            'Doctrine\DBAL\Query\QueryBuilder'   => 'Lexik\Bundle\FormFilterBundle\Filter\Doctrine\DBALQuery',
            'Doctrine\ODM\MongoDB\Query\Builder' => 'Lexik\Bundle\FormFilterBundle\Filter\Doctrine\MongodbQuery',
        );

        foreach ($queryClasses as $builderClass => $queryClass) {
            if (class_exists($builderClass) && $qb instanceof $builderClass) {
                $query = new $queryClass($qb, $this->getForceCaseInsensitivity($qb), $this->encoding);

                $event->setFilterQuery($query);
                $event->stopPropagation();

                return;
            }
        }
    }
public function onFilterBuilderPrepare(PrepareEvent $event)
    {
        $qb = $event->getQueryBuilder();

        $queryClasses = array(
            'Doctrine\ORM\QueryBuilder'          => 'Lexik\Bundle\FormFilterBundle\Filter\Doctrine\ORMQuery',
            'Doctrine\DBAL\Query\QueryBuilder'   => 'Lexik\Bundle\FormFilterBundle\Filter\Doctrine\DBALQuery',
            'Doctrine\ODM\MongoDB\Query\Builder' => 'Lexik\Bundle\FormFilterBundle\Filter\Doctrine\MongodbQuery',
        );

        foreach ($queryClasses as $builderClass => $queryClass) {
            if (class_exists($builderClass) && $qb instanceof $builderClass) {
                $query = new $queryClass($qb, $this->getForceCaseInsensitivity($qb), $this->encoding);

                $event->setFilterQuery($query);
                $event->stopPropagation();

                return;
            }
        }
    }
public function onFilterBuilderPrepare ( PrepareEvent $ event ) { $ qb = $ event -> getQueryBuilder ( ) ; $ queryClasses = array ( 'Doctrine\ORM\QueryBuilder' => 'Lexik\Bundle\FormFilterBundle\Filter\Doctrine\ORMQuery' , 'Doctrine\DBAL\Query\QueryBuilder' => 'Lexik\Bundle\FormFilterBundle\Filter\Doctrine\DBALQuery' , 'Doctrine\ODM\MongoDB\Query\Builder' => 'Lexik\Bundle\FormFilterBundle\Filter\Doctrine\MongodbQuery' , ) ; foreach ( $ queryClasses as $ builderClass => $ queryClass ) { if ( class_exists ( $ builderClass ) && $ qb instanceof $ builderClass ) { $ query = new $ queryClass ( $ qb , $ this -> getForceCaseInsensitivity ( $ qb ) , $ this -> encoding ) ; $ event -> setFilterQuery ( $ query ) ; $ event -> stopPropagation ( ) ; return ; } } }
Filter builder prepare event

@param PrepareEvent $event
Filter builder prepare event