private function createFilteredQuery(array $filters)
    {
        $qb = $this->createQuery('entity');

        foreach ($filters as $field => $filter) {
            $qb->andWhere(is_array($filter)
                    ? sprintf('entity.%s in (:%s)', $field, $field)
                    : sprintf('entity.%s = :%s', $field, $field)
                )
                ->setParameter(sprintf(':%s', $field), $filter)
            ;
        }

        return $qb->getQuery();
    }
private function createFilteredQuery(array $filters)
    {
        $qb = $this->createQuery('entity');

        foreach ($filters as $field => $filter) {
            $qb->andWhere(is_array($filter)
                    ? sprintf('entity.%s in (:%s)', $field, $field)
                    : sprintf('entity.%s = :%s', $field, $field)
                )
                ->setParameter(sprintf(':%s', $field), $filter)
            ;
        }

        return $qb->getQuery();
    }
private function createFilteredQuery ( array $ filters ) { $ qb = $ this -> createQuery ( 'entity' ) ; foreach ( $ filters as $ field => $ filter ) { $ qb -> andWhere ( is_array ( $ filter ) ? sprintf ( 'entity.%s in (:%s)' , $ field , $ field ) : sprintf ( 'entity.%s = :%s' , $ field , $ field ) ) -> setParameter ( sprintf ( ':%s' , $ field ) , $ filter ) ; } return $ qb -> getQuery ( ) ; }
create query an filter it with given data.

@param array $filters

@return Query
create query an filter it with given data .