public function __construct(DoctrineOrmPaginator $paginator)
{
$this->paginator = $paginator;
$query = $paginator->getQuery();
$this->firstResult = $query->getFirstResult();
$this->maxResults = $query->getMaxResults();
$this->totalItems = count($paginator);
}