SitemapPage
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
Returns the XML representation of this element.
Returns a SimpleXMLElement instance representing this element.
No description
Get the URL of the page.
Set the URL of the page.
Get the last modification date/time.
Get the page change frequency (one of the SitemapPage::CHANGEFREQUENCY_... constants, or an empty string in unavailable).
Set the page change frequency.
Get the page priority.
Set the page priority.
Get the pages in alternative languages mapped to this page.
Add a page in an alternative language that's mapped to this page.
Should this page be skipped?
Should this page be skipped?
Details
string[]|null
toXmlLines(string $indenter = ' ')
Returns the XML representation of this element.
SimpleXMLElement|null
toXmlElement(SimpleXMLElement $parentElement = null)
Returns a SimpleXMLElement instance representing this element.
protected string
getXmlMetaHeader()
Get the XML meta-header.
__construct(Page $page, UrlInterface $url, DateTime $lastModifiedAt = null, string $changeFrequency = '', string $priority = '')
No description
Page
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.
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.
bool
isSkip()
Should this page be skipped?
$this
setSkip(bool $skip)
Should this page be skipped?