whiteoctober / Pagerfanta

Pagination for PHP.
Other
1.59k stars 2 forks source link

Doctrine dbal groupby #284

Open tugrul opened 4 years ago

tugrul commented 4 years ago

Sample usecase:

$pager = new Pagerfanta(new DoctrineDbalAdapter($query, function (QueryBuilder $queryBuilder) {
    return $queryBuilder->getConnection()
        ->createQueryBuilder()
        ->select('COUNT(*) AS total')
        ->from('(' . $queryBuilder->getSQL()  . ')', 'QL')
        ->setMaxResults(1)
        ->setParameters($queryBuilder->getParameters());
}));
sampart commented 4 years ago

See https://github.com/whiteoctober/Pagerfanta/issues/169

sampart commented 4 years ago

Thanks for this, @tugrul. I'm not able to test this, so please could you confirm what testing you've done? Thanks