XmlSitemap

final readonly class \TYPO3\CMS\Seo\XmlSitemap\XmlSitemap

The result of a XmlSitemapDataProvider: The items of the requested page, and the information needed to render the sitemap index (last modification date and the total number of pages).

The items are resolved when they are requested, since the sitemap index needs the meta information only and therefore never renders any item.

Table of Contents

Constants

DEFAULT_ITEMS_PER_PAGE  : mixed = 1000

Methods

create()  : self
Creates a sitemap for providers taking care of paging themselves, for instance by limiting their database query to the items of the requested page.
forPage()  : self
Creates a sitemap for a single page out of all items a provider has collected. The optional item mapper is applied to the items of the requested page only, which allows providers to generate URLs for those items exclusively.
getItems()  : array
getLastModified()  : int
getNumberOfPages()  : int

Constants

DEFAULT_ITEMS_PER_PAGE

public mixed DEFAULT_ITEMS_PER_PAGE = 1000

Methods

create()

Creates a sitemap for providers taking care of paging themselves, for instance by limiting their database query to the items of the requested page.

public static create(callable(): array $itemsResolver, int $lastModified, int $numberOfPages) : self

Parameters

$itemsResolver : callable(): array

Resolves the items of the requested page

$lastModified : int
$numberOfPages : int

Return values

self

forPage()

Creates a sitemap for a single page out of all items a provider has collected. The optional item mapper is applied to the items of the requested page only, which allows providers to generate URLs for those items exclusively.

public static forPage(array $allItems[, int $page = 0 ][, callable(array): array|null $itemMapper = null ][, int $itemsPerPage = self::DEFAULT_ITEMS_PER_PAGE ]) : self

Parameters

$allItems : array
$page : int = 0
$itemMapper : callable(array): array|null = null
$itemsPerPage : int = self::DEFAULT_ITEMS_PER_PAGE

Return values

self

getItems()

public getItems() : array

Return values

array

getLastModified()

public getLastModified() : int

Return values

int

getNumberOfPages()

public getNumberOfPages() : int

Return values

int
On this page