setCurrentPageNumber($currentPageNumber); $this->setItemsPerPage($itemsPerPage); $this->updateInternalState(); } public function getPaginatedItems(): iterable { return $this->paginatedQueryResult; } protected function updatePaginatedItems(int $limit, int $offset): void { $this->paginatedQueryResult = $this->queryResult ->getQuery() ->setLimit($limit) ->setOffset($offset) ->execute(); } protected function getTotalAmountOfItems(): int { return count($this->queryResult); } protected function getAmountOfItemsOnCurrentPage(): int { return count($this->paginatedQueryResult); } }