Example #1
0
 /**
  * Set total rows count without filters.
  *
  * @param Table $table
  */
 private function setTotalRows(Table $table)
 {
     $qb = $table->getQueryBuilder();
     $qbtr = clone $qb;
     $identifiers = $table->getIdentifierFieldNames();
     if (is_null($identifiers)) {
         $paginatorTotal = new Paginator($qbtr->getQuery());
         $count = $paginatorTotal->count();
     } else {
         $qbtr->select($qbtr->expr()->count($identifiers));
         $count = (int) $qbtr->getQuery()->getSingleScalarResult();
     }
     $table->setTotalRows($count);
 }