XmlSitemapPageTree
extends PageTree
in package
Handler to generate XML sitemaps
Instances of this class correspond to a single XML sitemap file. Whereas the static method XmlSitemapPageTree::write() does generate all XML sitemap files.
Tags
Table of Contents
Properties
- $bytes : mixed
- $considerLogin : mixed
- $considerSeoEnabledOnly : bool
- Consider seo enabled pages alone
- $currentPage : mixed
- $currentPageOnRootNode : mixed
- $currentPagePath : mixed
- $depth : mixed
- $em : mixed
- $file : File
- $lang : mixed
- $license : mixed
- $localeCode : string
- $nodeRepo : mixed
- $pageIdsAtCurrentPath : mixed
- $pageRepo : mixed
- $rootNode : mixed
- $skipInactive : mixed
- $skipInvisible : mixed
- $startLevel : mixed
- $startPath : mixed
- $virtualLanguageDirectory : mixed
- $virtualPagesAdded : mixed
- $strFileName : mixed
- $strFileNameWithLang : mixed
Methods
- __construct() : mixed
- Override the constructor from the PageTree
- getFile() : File
- Return file instance of XML sitemap file
- getLocaleCode() : string
- Return locale code of XML sitemap file
- getUrl() : Url
- Return URL of this XML sitemap's location
- isPagePathActive() : bool
- Tells wheter $pathToPage is in the active branch
- postRenderLevel() : mixed
- preRenderLevel() : mixed
- render() : string
- returns the string representation of the tree.
- setVirtualLanguageDirectory() : mixed
- write() : bool
- Writes the XML-Sitemap in all langs (if activated in config)
- cleanUp() : void
- Drop XML sitemaps from filesystem that are no longer in use.
- getChangingFrequency() : string
- Returns the changing-frequency of the page depending on the database values. If the page is a module page, the frequency is set to 'hourly', for normal pages to 'weekly'.
- getFirstLevel() : mixed
- getFullNavigation() : bool
- getLastLevel() : mixed
- getLastModificationDate() : string
- Creates the modification-date of a page as a string which can be processed by google. The method uses for module-pages the current date, for normale pages the date of last modification.
- getMetaImageOfPage() : string
- Get the path of the set meta image of $page. If $page does not have a meta image set, then the path to the default meta image set by the basic configuration is returned instead.
- init() : mixed
- Called on construction. Override if you do not want to override the ctor.
- postRender() : mixed
- PageTree override (unused)
- postRenderElement() : string
- PageTree override (unused)
- preRender() : mixed
- PageTree override (unused)
- preRenderElement() : mixed
- renderElement() : type
- Renders the PageTree element
- renderFooter() : string
- Renders the foot of the PageTree
- renderHeader() : type
- Renders the head of the PageTree
- writeXML() : mixed
- Write sitemap-file
Properties
$bytes
protected
mixed
$bytes
$considerLogin
protected
mixed
$considerLogin
= true
$considerSeoEnabledOnly
Consider seo enabled pages alone
protected
bool
$considerSeoEnabledOnly
$currentPage
protected
mixed
$currentPage
= null
$currentPageOnRootNode
protected
mixed
$currentPageOnRootNode
= false
$currentPagePath
protected
mixed
$currentPagePath
= null
$depth
protected
mixed
$depth
= null
$em
protected
mixed
$em
= null
$file
protected
File
$file
$lang
protected
mixed
$lang
= null
$license
protected
mixed
$license
= null
$localeCode
protected
string
$localeCode
= ''
$nodeRepo
protected
mixed
$nodeRepo
$pageIdsAtCurrentPath
protected
mixed
$pageIdsAtCurrentPath
= array()
$pageRepo
protected
mixed
$pageRepo
= null
$rootNode
protected
mixed
$rootNode
= null
$skipInactive
protected
mixed
$skipInactive
$skipInvisible
protected
mixed
$skipInvisible
= true
$startLevel
protected
mixed
$startLevel
$startPath
protected
mixed
$startPath
$virtualLanguageDirectory
protected
mixed
$virtualLanguageDirectory
$virtualPagesAdded
protected
static mixed
$virtualPagesAdded
= false
$strFileName
private
static mixed
$strFileName
= 'sitemap.xml'
$strFileNameWithLang
private
static mixed
$strFileNameWithLang
= 'sitemap_%s.xml'
Methods
__construct()
Override the constructor from the PageTree
public
__construct(type $entityManager, type $license[, type $maxDepth = 0 ][, type $rootNode = null ][, type $lang = null ][, type $currentPage = null ][, type $skipInvisible = false ][, type $considerLogin = false ][, bool $skipInactive = true ][, bool $considerSeoEnabledOnly = true ]) : mixed
Parameters
- $entityManager : type
- $license : type
- $maxDepth : type = 0
- $rootNode : type = null
- $lang : type = null
- $currentPage : type = null
- $skipInvisible : type = false
- $considerLogin : type = false
- $skipInactive : bool = true
-
Skip inactive pages
- $considerSeoEnabledOnly : bool = true
-
Consider seo enabled pages alone
Tags
getFile()
Return file instance of XML sitemap file
public
getFile() : File
Return values
File —Value of static::$file
getLocaleCode()
Return locale code of XML sitemap file
public
getLocaleCode() : string
Return values
string —Value of static::$localeCode
getUrl()
Return URL of this XML sitemap's location
public
getUrl() : Url
Return values
Url —URL of this XML-sitemap
isPagePathActive()
Tells wheter $pathToPage is in the active branch
public
isPagePathActive(string $pathToPage) : bool
Parameters
- $pathToPage : string
Return values
bool —True if active, false otherwise
postRenderLevel()
public
postRenderLevel(mixed $level, mixed $lang, mixed $parentNode) : mixed
Parameters
- $level : mixed
- $lang : mixed
- $parentNode : mixed
preRenderLevel()
public
preRenderLevel(mixed $level, mixed $lang, mixed $parentNode) : mixed
Parameters
- $level : mixed
- $lang : mixed
- $parentNode : mixed
render()
returns the string representation of the tree.
public
render() : string
Return values
stringsetVirtualLanguageDirectory()
public
setVirtualLanguageDirectory(mixed $dir) : mixed
Parameters
- $dir : mixed
write()
Writes the XML-Sitemap in all langs (if activated in config)
public
static write() : bool
Tags
Return values
bool —True on success (including deactivated), false otherwise
cleanUp()
Drop XML sitemaps from filesystem that are no longer in use.
protected
static cleanUp() : void
getChangingFrequency()
Returns the changing-frequency of the page depending on the database values. If the page is a module page, the frequency is set to 'hourly', for normal pages to 'weekly'.
protected
getChangingFrequency(mixed $page) : string
Parameters
- $page : mixed
Return values
string —true, if the page is a module page. Otherwise false.
getFirstLevel()
protected
getFirstLevel() : mixed
getFullNavigation()
protected
getFullNavigation(int $level) : bool
Parameters
- $level : int
Return values
boolgetLastLevel()
protected
getLastLevel() : mixed
getLastModificationDate()
Creates the modification-date of a page as a string which can be processed by google. The method uses for module-pages the current date, for normale pages the date of last modification.
protected
getLastModificationDate(mixed $page) : string
Parameters
- $page : mixed
Return values
string —A date string which can be understood by google
getMetaImageOfPage()
Get the path of the set meta image of $page. If $page does not have a meta image set, then the path to the default meta image set by the basic configuration is returned instead.
protected
getMetaImageOfPage(Page $page) : string
Parameters
- $page : Page
Return values
string —Path to meta image
init()
Called on construction. Override if you do not want to override the ctor.
protected
init() : mixed
postRender()
PageTree override (unused)
protected
postRender(type $lang) : mixed
Parameters
- $lang : type
postRenderElement()
PageTree override (unused)
protected
postRenderElement(type $level, type $hasChilds, type $lang, type $page) : string
Parameters
- $level : type
- $hasChilds : type
- $lang : type
- $page : type
Return values
stringpreRender()
PageTree override (unused)
protected
preRender(type $lang) : mixed
Parameters
- $lang : type
preRenderElement()
protected
preRenderElement(mixed $level, mixed $hasChilds, mixed $lang, mixed $page) : mixed
Parameters
- $level : mixed
- $hasChilds : mixed
- $lang : mixed
- $page : mixed
renderElement()
Renders the PageTree element
protected
renderElement(type $title, type $level, type $hasChilds, type $lang, type $path, type $current, type $page) : type
Parameters
- $title : type
- $level : type
- $hasChilds : type
- $lang : type
- $path : type
- $current : type
- $page : type
Return values
typerenderFooter()
Renders the foot of the PageTree
protected
renderFooter(type $lang) : string
Parameters
- $lang : type
Return values
stringrenderHeader()
Renders the head of the PageTree
protected
renderHeader(type $lang) : type
Parameters
- $lang : type
Return values
typewriteXML()
Write sitemap-file
protected
writeXML() : mixed