/** * @param Repositories\BaseRepository $repository * @param int $limit * @param Entities\UserEntity $user */ protected function runActionDefault(Repositories\BaseRepository $repository, $limit, Entities\UserEntity $user) { $this->checkIfDisplayInactiveOnly(); $this->canAccess = $this->canAccess(); if ($this->canAccess && $this->displayInactiveOnly) { $this->items = $repository->getAllInactiveForPage($this->paginatorFactory, $this->vp->page, $limit); } else { $this->items = $repository->getAllByUserForPage($this->paginatorFactory, $this->vp->page, $limit, $user); } $this->preparePaginator($this->items->count(), $limit); }
/** * @param Repositories\BaseRepository $repository * @param string $tagSlug * @param int $limit * @return Paginator */ protected function runActionDefault(Repositories\BaseRepository $repository, $tagSlug, $limit) { $this->checkIfDisplayInactiveOnly(); $tag = $this->getTag($tagSlug); $this->canAccess = $this->canAccess(); if ($this->canAccess && $this->displayInactiveOnly) { $items = $tag ? $repository->getAllInactiveByTagForPage($this->paginatorFactory, $this->vp->page, $limit, $tag) : $repository->getAllInactiveForPage($this->paginatorFactory, $this->vp->page, $limit); } else { $state = !$this->canAccess; $items = $tag ? $repository->getAllByTagForPage($this->paginatorFactory, $this->vp->page, $limit, $tag, $state) : $repository->getAllForPage($this->paginatorFactory, $this->vp->page, $limit, $state); } $this->preparePaginator($items->count(), $limit); $this->throw404IfNoItemsOnPage($items, $tag); $this->tag = $tag; return $items; }