ApiPlatform\Core\Bridge\Doctrine\Orm\Paginator::__construct PHP Method

__construct() public method

public __construct ( Doctrine\ORM\Tools\Pagination\Paginator $paginator )
$paginator Doctrine\ORM\Tools\Pagination\Paginator
    public function __construct(DoctrineOrmPaginator $paginator)
    {
        $this->paginator = $paginator;
        $query = $paginator->getQuery();
        $this->firstResult = $query->getFirstResult();
        $this->maxResults = $query->getMaxResults();
        $this->totalItems = count($paginator);
    }