protected function applyCriteria(QueryBuilder $queryBuilder, array $criteria = [])
    {
        foreach ($criteria as $property => $value) {
            $name = $this->getPropertyName($property);
            if (null === $value) {
                $queryBuilder->andWhere($queryBuilder->expr()->isNull($name));
            } elseif (is_array($value)) {
                $queryBuilder->andWhere($queryBuilder->expr()->in($name, $value));
            } elseif ('' !== $value) {
                $parameter = str_replace('.', '_', $property);
                $queryBuilder
                    ->andWhere($queryBuilder->expr()->eq($name, ':'.$parameter))
                    ->setParameter($parameter, $value)
                ;
            }
        }
    }
protected function applyCriteria(QueryBuilder $queryBuilder, array $criteria = [])
    {
        foreach ($criteria as $property => $value) {
            $name = $this->getPropertyName($property);
            if (null === $value) {
                $queryBuilder->andWhere($queryBuilder->expr()->isNull($name));
            } elseif (is_array($value)) {
                $queryBuilder->andWhere($queryBuilder->expr()->in($name, $value));
            } elseif ('' !== $value) {
                $parameter = str_replace('.', '_', $property);
                $queryBuilder
                    ->andWhere($queryBuilder->expr()->eq($name, ':'.$parameter))
                    ->setParameter($parameter, $value)
                ;
            }
        }
    }
protected function applyCriteria ( QueryBuilder $ queryBuilder , array $ criteria = [ ] ) { foreach ( $ criteria as $ property => $ value ) { $ name = $ this -> getPropertyName ( $ property ) ; if ( null === $ value ) { $ queryBuilder -> andWhere ( $ queryBuilder -> expr ( ) -> isNull ( $ name ) ) ; } elseif ( is_array ( $ value ) ) { $ queryBuilder -> andWhere ( $ queryBuilder -> expr ( ) -> in ( $ name , $ value ) ) ; } elseif ( '' !== $ value ) { $ parameter = str_replace ( '.' , '_' , $ property ) ; $ queryBuilder -> andWhere ( $ queryBuilder -> expr ( ) -> eq ( $ name , ':' . $ parameter ) ) -> setParameter ( $ parameter , $ value ) ; } } }
Applies the criteria to the query builder.

@param QueryBuilder $queryBuilder
@param array        $criteria
Applies the criteria to the query builder .