Right away I would say, that I read this question Doctrine2 Paginator, but it doesn't give me enough information regarding the title of my question.

When I used Doctrine1 I was getting the result with such code for example:

$list = $this->query
    ->addSelect( 'SQL_CALC_FOUND_ROWS *' )
    ->offset( ( $this->currentPage - 1 ) * $this->perPage )
    ->limit( $this->perPage )
    ->execute( array(), \Doctrine_Core::HYDRATE_ARRAY_SHALLOW );

$totalRecords     = SqlCalcFoundRowsEventListener::getFoundRowsCount();
$this->totalPages = ceil( $totalRecords / $this->perPage );

and it was great.

Now, when using Doctrine2 I'm confused on how should I get total amount of records with same query as limited result for current page.

Any help/advice would be greatly appreciated.

Edit
Report