SiteFinder
readonly class \
Is used in backend and frontend for all places where to read / identify sites and site languages.
Table of Contents
Methods
- __construct() : mixed
- getAllSites() : Site[]
- Return a list of all configured sites
- getSiteByIdentifier() : Site
- Find a site by given identifier
- getSiteByPage() : Site
- Finds the site of an already resolved page. Only the root line of its parent page is needed, which is usually already known when rendering menus or links.
- getSiteByPageId() : Site
- Traverses the rootline of a page up until a Site was found.
- getSiteByRootPageId() : Site
- Find a site by given root page id
- siteConfigurationChanged() : void
Methods
__construct()
public
__construct(SiteConfiguration $siteConfiguration, FrontendInterface $runtimeCache) : mixed
Parameters
- $siteConfiguration : SiteConfiguration
- $runtimeCache : FrontendInterface
getAllSites()
Return a list of all configured sites
public
getAllSites([bool $useCache = true ]) : Site[]
Parameters
- $useCache : bool = true
Return values
Site[]getSiteByIdentifier()
Find a site by given identifier
public
getSiteByIdentifier(string $identifier) : Site
Parameters
- $identifier : string
Tags
Return values
SitegetSiteByPage()
Finds the site of an already resolved page. Only the root line of its parent page is needed, which is usually already known when rendering menus or links.
public
getSiteByPage(Page $page[, string $mountPointParameter = '' ]) : Site
Parameters
- $page : Page
- $mountPointParameter : string = ''
Tags
Return values
SitegetSiteByPageId()
Traverses the rootline of a page up until a Site was found.
public
getSiteByPageId(int $pageId[, array|null $rootLine = null ][, string|null $mountPointParameter = null ]) : Site
Parameters
- $pageId : int
- $rootLine : array|null = null
- $mountPointParameter : string|null = null
Tags
Return values
SitegetSiteByRootPageId()
Find a site by given root page id
public
getSiteByRootPageId(int $rootPageId) : Site
Parameters
- $rootPageId : int
-
the page ID (default language)
Internal
only for usage in some places for managing Site Configuration, might be removed without further notice
Tags
Return values
SitesiteConfigurationChanged()
public
siteConfigurationChanged() : void
Attributes
- #[AsEventListener]
- $event: SiteConfigurationChangedEvent::class