public getContributors ( null | integer $page = null, integer $limit = 20 ) : Traversable | ||
$page | null | integer | |
$limit | integer | |
Результат | Traversable |
public function getContributors($page = null, $limit = 20)
{
if (null === $page) {
return $this->contributors;
}
$paginator = new Pagerfanta(new DoctrineCollectionAdapter($this->contributors));
$paginator->setMaxPerPage($limit)->setCurrentPage($page);
return $paginator->getCurrentPageResults();
}