omines / datatables-bundle

DataTables bundle for Symfony
https://omines.github.io/datatables-bundle/
MIT License
260 stars 114 forks source link

ORMAdapter::getCount() miscalculates #352

Open MIvanIsten opened 2 months ago

MIvanIsten commented 2 months ago

It does not take into account if there is a HAVING clause filtering out rows. Are there any obstacles to using the builtin doctrine solution? (which counts correctly)

use Doctrine\ORM\Tools\Pagination\Paginator;

    protected function getCount(QueryBuilder $queryBuilder, mixed $identifier): int
    {
        $paginator = new Paginator($queryBuilder->getQuery(), true);

        return $paginator->count();
    }
github-actions[bot] commented 4 days ago

Stale issue message