class SitemapGenerator (View source)

Class to be used to generate the elements to be included in a sitemap.xml file.

Properties

protected Application $app
protected Repository $config
protected string $customSiteCanonicalUrl
private PageListGenerator|null $pageListGenerator
private ResolverManagerInterface|null $resolverManager
private PageKey|null|false $sitemapChangeFrequencyAttributeKey
private PageKey|null|false $sitemapPriorityAttributeKey
private string|false $defaultChangeFrequency
private string|false $defaultPriority

Methods

__construct(Application $app, Repository $config)

Initialize the instance.

setPageListGenerator(PageListGenerator $pageListGenerator)

No description

setResolverManager(ResolverManagerInterface $resolverManager)

No description

string
getSiteCanonicalUrl()

Get the currently configured canonical URL of the site.

string
getCustomSiteCanonicalUrl()

Get the custom canonical URL for the site.

$this
setCustomSiteCanonicalUrl(string $customSiteCanonicalUrl)

Set the custom canonical URL for the site.

URLInterface
resolveUrl(string $sitemapFile)

Resolve an URL using the custom site canonical URL (if set).

PageKey|null
string
getDefaultChangeFrequency()

No description

string
getDefaultPriority()

No description

URLInterface
getPageUrl(Page $page)

No description

string
getPageChangeFrequency(Page $page)

No description

string
getPagePriority(Page $page)

No description

createSitemapPage(Page $page, bool $multilingualEnabled)

No description

populateLanguageAlternatives(SitemapPage $sitemapPage)

No description

Details

__construct(Application $app, Repository $config)

Initialize the instance.

Parameters

Application $app
Repository $config

PageListGenerator getPageListGenerator()

No description

Return Value

PageListGenerator

setPageListGenerator(PageListGenerator $pageListGenerator)

No description

Parameters

PageListGenerator $pageListGenerator

ResolverManagerInterface getResolverManager()

No description

setResolverManager(ResolverManagerInterface $resolverManager)

No description

Parameters

ResolverManagerInterface $resolverManager

SitemapElement[]|Generator generateContents()

No description

Return Value

SitemapElement[]|Generator

string getSiteCanonicalUrl()

Get the currently configured canonical URL of the site.

Return Value

string

string getCustomSiteCanonicalUrl()

Get the custom canonical URL for the site.

Return Value

string

$this setCustomSiteCanonicalUrl(string $customSiteCanonicalUrl)

Set the custom canonical URL for the site.

Parameters

string $customSiteCanonicalUrl

Return Value

$this

URLInterface resolveUrl(string $sitemapFile)

Resolve an URL using the custom site canonical URL (if set).

Parameters

string $sitemapFile

Return Value

URLInterface

protected PageKey|null getSitemapChangeFrequencyAttributeKey()

No description

Return Value

PageKey|null

protected PageKey|null getSitemapPriorityAttributeKey()

No description

Return Value

PageKey|null

protected string getDefaultChangeFrequency()

No description

Return Value

string

protected string getDefaultPriority()

No description

Return Value

string

protected URLInterface getPageUrl(Page $page)

No description

Parameters

Page $page

Return Value

URLInterface

protected string getPageChangeFrequency(Page $page)

No description

Parameters

Page $page

Return Value

string

protected string getPagePriority(Page $page)

No description

Parameters

Page $page

Return Value

string

protected SitemapPage createSitemapPage(Page $page, bool $multilingualEnabled)

No description

Parameters

Page $page
bool $multilingualEnabled

Return Value

SitemapPage

protected populateLanguageAlternatives(SitemapPage $sitemapPage)

No description

Parameters

SitemapPage $sitemapPage