key = $key; $this->config = $config; $this->request = $request; $this->cObj = $cObj ?? GeneralUtility::makeInstance(ContentObjectRenderer::class); $this->cObj->setRequest($request); } public function getKey(): string { return $this->key; } public function getNumberOfPages(): int { return (int)ceil(count($this->items) / $this->numberOfItemsPerPage); } public function getLastModified(): int { $lastMod = 0; foreach ($this->items as $item) { if ((int)($item['lastMod'] ?? 0) > $lastMod) { $lastMod = (int)$item['lastMod']; } } return $lastMod; } protected function defineUrl(array $data): array { return $data; } public function getItems(): array { $pageNumber = (int)($this->request->getQueryParams()['tx_seo']['page'] ?? 0); $page = $pageNumber > 0 ? $pageNumber : 0; $items = array_slice( $this->items, $page * $this->numberOfItemsPerPage, $this->numberOfItemsPerPage ); return array_map([$this, 'defineUrl'], $items); } }