‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Site\SiteFinder Class Reference

Public Member Functions

 __construct (SiteConfiguration $siteConfiguration=null)
 
Site[] getAllSites (bool $useCache=true)
 
 getSiteByRootPageId (int $rootPageId)
 
 getSiteByIdentifier (string $identifier)
 
 getSiteByPageId (int $pageId, array $rootLine=null, string $mountPointParameter=null)
 

Protected Member Functions

 fetchAllSites (bool $useCache=true)
 

Protected Attributes

array $sites = []
 
array $mappingRootPageIdToIdentifier = []
 
SiteConfiguration $siteConfiguration
 

Detailed Description

Is used in backend and frontend for all places where to read / identify sites and site languages.

Definition at line 30 of file SiteFinder.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Site\SiteFinder::__construct ( SiteConfiguration  $siteConfiguration = null)

Fetches all existing configurations as Site objects

Definition at line 49 of file SiteFinder.php.

References TYPO3\CMS\Core\Site\SiteFinder\$siteConfiguration, and TYPO3\CMS\Core\Site\SiteFinder\fetchAllSites().

Member Function Documentation

◆ fetchAllSites()

TYPO3\CMS\Core\Site\SiteFinder::fetchAllSites ( bool  $useCache = true)
protected

◆ getAllSites()

Site [] TYPO3\CMS\Core\Site\SiteFinder::getAllSites ( bool  $useCache = true)

Return a list of all configured sites

Returns
Site[]

Definition at line 60 of file SiteFinder.php.

References TYPO3\CMS\Core\Site\SiteFinder\$sites, and TYPO3\CMS\Core\Site\SiteFinder\fetchAllSites().

◆ getSiteByIdentifier()

TYPO3\CMS\Core\Site\SiteFinder::getSiteByIdentifier ( string  $identifier)

Find a site by given identifier

Exceptions
SiteNotFoundException

Definition at line 88 of file SiteFinder.php.

References TYPO3\CMS\Webhooks\Message\$identifier.

◆ getSiteByPageId()

TYPO3\CMS\Core\Site\SiteFinder::getSiteByPageId ( int  $pageId,
array  $rootLine = null,
string  $mountPointParameter = null 
)

Traverses the rootline of a page up until a Site was found.

Parameters
string | null$mountPointParameter
Exceptions
SiteNotFoundException

Definition at line 102 of file SiteFinder.php.

◆ getSiteByRootPageId()

TYPO3\CMS\Core\Site\SiteFinder::getSiteByRootPageId ( int  $rootPageId)

Find a site by given root page id

Parameters
int$rootPageId‪the page ID (default language)
Exceptions
SiteNotFoundException

only for usage in some places for managing Site Configuration, might be removed without further notice

Definition at line 75 of file SiteFinder.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\SiteDatabaseEditRow\getRawConfigurationForSiteWithRootPageId().

Member Data Documentation

◆ $mappingRootPageIdToIdentifier

array TYPO3\CMS\Core\Site\SiteFinder::$mappingRootPageIdToIdentifier = []
protected

Definition at line 42 of file SiteFinder.php.

◆ $siteConfiguration

SiteConfiguration TYPO3\CMS\Core\Site\SiteFinder::$siteConfiguration
protected

Definition at line 44 of file SiteFinder.php.

Referenced by TYPO3\CMS\Core\Site\SiteFinder\__construct().

◆ $sites

array TYPO3\CMS\Core\Site\SiteFinder::$sites = []
protected

Definition at line 35 of file SiteFinder.php.

Referenced by TYPO3\CMS\Core\Site\SiteFinder\getAllSites().