class SitemapPage extends SitemapElement (View source)

Constants

DEFAULT_NAMESPACE

The default sitemap namespace.

MULTILINGUAL_NAMESPACE

The namespace required for the multilingual alternatives.

MULTILINGUAL_NAMESPACE_NAME

The alias of the namespace required for the multilingual alternatives.

CHANGEFREQUENCY_ALWAYS

Change frequency: always (pagess change each time they are accessed).

CHANGEFREQUENCY_HOURLY

Change frequency: hourly.

CHANGEFREQUENCY_DAILY

Change frequency: daily.

CHANGEFREQUENCY_WEEKLY

Change frequency: weekly.

CHANGEFREQUENCY_MONTHLY

Change frequency: monthly.

CHANGEFREQUENCY_YEARLY

Change frequency: yearly.

CHANGEFREQUENCY_NEVER

Change frequency: never (should be used to describe archived URLs).

Properties

protected Page $page

The page.

protected UrlInterface $url

The URL of the page.

protected DateTime|null $lastModifiedAt

The last modification date/time.

protected string $changeFrequency

The page change frequency (one of the SitemapPage::CHANGEFREQUENCY_... constants, or an empty string in unavailable).

protected string $priority

The page priority.

protected SitemapPageAlternativeLanguage[] $alternativeLanguages

The pages in alternative languages mapped to this page.

protected bool $skip

Should this page be skipped?

Methods

string[]|null
toXmlLines(string $indenter = ' ')

Returns the XML representation of this element.

toXmlElement(SimpleXMLElement $parentElement = null)

Returns a SimpleXMLElement instance representing this element.

string
getXmlMetaHeader()

Get the XML meta-header.

__construct(Page $page, UrlInterface $url, DateTime $lastModifiedAt = null, string $changeFrequency = '', string $priority = '')

No description

getPage()

Get the page.

UrlInterface
getUrl()

Get the URL of the page.

$this
setUrl(UrlInterface $url)

Set the URL of the page.

DateTime|null
getLastModifiedAt()

Get the last modification date/time.

$this
setLastModifiedAt(DateTime $lastModifiedAt = null)

Set the last modification date/time.

string
getChangeFrequency()

Get the page change frequency (one of the SitemapPage::CHANGEFREQUENCY_... constants, or an empty string in unavailable).

$this
setChangeFrequency(string $changeFrequency)

Set the page change frequency.

string
getPriority()

Get the page priority.

$this
setPriority(string $priority)

Set the page priority.

getAlternativeLanguages()

Get the pages in alternative languages mapped to this page.

$this
addAlternativeLanguage(SitemapPageAlternativeLanguage $alternative)

Add a page in an alternative language that's mapped to this page.

bool
isSkip()

Should this page be skipped?

$this
setSkip(bool $skip)

Should this page be skipped?

Details

string[]|null toXmlLines(string $indenter = ' ')

Returns the XML representation of this element.

Parameters

string $indenter

The string used to indent the XML

Return Value

string[]|null

Returns NULL in case no data should be generated, the XML lines otherwise

See also

SitemapElement::toXmlLines

SimpleXMLElement|null toXmlElement(SimpleXMLElement $parentElement = null)

Returns a SimpleXMLElement instance representing this element.

Parameters

SimpleXMLElement $parentElement

Return Value

SimpleXMLElement|null

See also

SitemapElement::toXmlElement

protected string getXmlMetaHeader()

Get the XML meta-header.

Return Value

string

__construct(Page $page, UrlInterface $url, DateTime $lastModifiedAt = null, string $changeFrequency = '', string $priority = '')

No description

Parameters

Page $page

the page

UrlInterface $url

the URL of the page

DateTime $lastModifiedAt

the last modification date/time

string $changeFrequency

the page change frequency (one of the SitemapPage::CHANGEFREQUENCY_... constants, or an empty string in unavailable)

string $priority

the page priority

Page getPage()

Get the page.

Return Value

Page

UrlInterface getUrl()

Get the URL of the page.

Return Value

UrlInterface

$this setUrl(UrlInterface $url)

Set the URL of the page.

Parameters

UrlInterface $url

Return Value

$this

DateTime|null getLastModifiedAt()

Get the last modification date/time.

Return Value

DateTime|null

$this setLastModifiedAt(DateTime $lastModifiedAt = null)

Set the last modification date/time.

Parameters

DateTime $lastModifiedAt

Return Value

$this

string getChangeFrequency()

Get the page change frequency (one of the SitemapPage::CHANGEFREQUENCY_... constants, or an empty string in unavailable).

Return Value

string

$this setChangeFrequency(string $changeFrequency)

Set the page change frequency.

Parameters

string $changeFrequency

one of the SitemapPage::CHANGEFREQUENCY_... constants, or an empty string in unavailable

Return Value

$this

string getPriority()

Get the page priority.

Return Value

string

$this setPriority(string $priority)

Set the page priority.

Parameters

string $priority

Return Value

$this

SitemapPageAlternativeLanguage[] getAlternativeLanguages()

Get the pages in alternative languages mapped to this page.

$this addAlternativeLanguage(SitemapPageAlternativeLanguage $alternative)

Add a page in an alternative language that's mapped to this page.

Parameters

SitemapPageAlternativeLanguage $alternative

Return Value

$this

bool isSkip()

Should this page be skipped?

Return Value

bool

$this setSkip(bool $skip)

Should this page be skipped?

Parameters

bool $skip

Return Value

$this