Services/TableService.php
private function setFilteredRows(Table $table, Request $request)
    {
        $qb = $table->getQueryBuilder();
        $qbfr = clone $qb;
        $this->addSearch($table, $request, $qbfr);

        $identifiers = $table->getIdentifierFieldNames();

        if (is_null($identifiers)) {
            $paginatorFiltered = new Paginator($qbfr->getQuery());
            $count = $paginatorFiltered->count();
        } else {
            $qbfr->select($qbfr->expr()->count($identifiers));
            $count = (int) $qbfr->getQuery()->getSingleScalarResult();
        }

        $table->setFilteredRows($count);
    }
private function setFilteredRows(Table $table, Request $request)
    {
        $qb = $table->getQueryBuilder();
        $qbfr = clone $qb;
        $this->addSearch($table, $request, $qbfr);

        $identifiers = $table->getIdentifierFieldNames();

        if (is_null($identifiers)) {
            $paginatorFiltered = new Paginator($qbfr->getQuery());
            $count = $paginatorFiltered->count();
        } else {
            $qbfr->select($qbfr->expr()->count($identifiers));
            $count = (int) $qbfr->getQuery()->getSingleScalarResult();
        }

        $table->setFilteredRows($count);
    }
private function setFilteredRows ( Table $ table , Request $ request ) { $ qb = $ table -> getQueryBuilder ( ) ; $ qbfr = clone $ qb ; $ this -> addSearch ( $ table , $ request , $ qbfr ) ; $ identifiers = $ table -> getIdentifierFieldNames ( ) ; if ( is_null ( $ identifiers ) ) { $ paginatorFiltered = new Paginator ( $ qbfr -> getQuery ( ) ) ; $ count = $ paginatorFiltered -> count ( ) ; } else { $ qbfr -> select ( $ qbfr -> expr ( ) -> count ( $ identifiers ) ) ; $ count = ( int ) $ qbfr -> getQuery ( ) -> getSingleScalarResult ( ) ; } $ table -> setFilteredRows ( $ count ) ; }
Set total rows count with filters.

@param Table   $table
@param Request $request
Set total rows count with filters .