‪TYPO3CMS  10.4
TYPO3\CMS\Core\Site\Entity\NullSite Class Reference
Inheritance diagram for TYPO3\CMS\Core\Site\Entity\NullSite:
TYPO3\CMS\Core\Site\Entity\SiteInterface

Public Member Functions

 __construct (array $languages=null, Uri $baseEntryPoint=null)
 
string getIdentifier ()
 
 getBase ()
 
int getRootPageId ()
 
SiteLanguage[] getLanguages ()
 
SiteLanguage getLanguageById (int $languageId)
 
 getDefaultLanguage ()
 
 getAvailableLanguages (BackendUserAuthentication $user, bool $includeAllLanguagesFlag=false, int $pageId=null)
 
PageErrorHandlerInterface getErrorHandler (int $statusCode)
 

Protected Member Functions

LanguageService getLanguageService ()
 

Protected Attributes

int $rootPageId = 0
 
SiteLanguage[] $languages
 

Detailed Description

Entity representing a site for everything on "pid=0". Mostly used in TYPO3 Backend, not really in use elsewhere.

Definition at line 31 of file NullSite.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Site\Entity\NullSite::__construct ( array  $languages = null,
Uri  $baseEntryPoint = null 
)

Sets up a null site object

Parameters
array$languages‪(sys_language objects)
Uri | null$baseEntryPoint

Definition at line 47 of file NullSite.php.

References TYPO3\CMS\Core\Site\Entity\NullSite\$languages.

Member Function Documentation

◆ getAvailableLanguages()

TYPO3\CMS\Core\Site\Entity\NullSite::getAvailableLanguages ( BackendUserAuthentication  $user,
bool  $includeAllLanguagesFlag = false,
int  $pageId = null 
)

This takes pageTSconfig into account (unlike Site interface) to find mod.SHARED.disableLanguages and mod.SHARED.defaultLanguageLabel

‪Fetch the available languages for a specific backend user, used in various places in Backend and Frontend when a Backend User is authenticated.

Parameters
BackendUserAuthentication$user‪the authenticated backend user to check access rights
bool$includeAllLanguagesFlag‪whether "-1" should be included in the values or not.
int$pageId‪usually used for resolving additional information from PageTS, only used for pseudo-sites. uid of the default language row!
Returns
SiteLanguage[]

Implements TYPO3\CMS\Core\Site\Entity\SiteInterface.

Definition at line 142 of file NullSite.php.

References TYPO3\CMS\Core\Authentication\BackendUserAuthentication\checkLanguageAccess(), TYPO3\CMS\Core\Site\Entity\NullSite\getBase(), TYPO3\CMS\Core\Site\Entity\NullSite\getLanguageService(), TYPO3\CMS\Backend\Utility\BackendUtility\getPagesTSconfig(), TYPO3\CMS\Core\Utility\GeneralUtility\intExplode(), and TYPO3\CMS\Core\Localization\LanguageService\sL().

◆ getBase()

TYPO3\CMS\Core\Site\Entity\NullSite::getBase ( )

◆ getDefaultLanguage()

TYPO3\CMS\Core\Site\Entity\NullSite::getDefaultLanguage ( )

‪Returns the first language that was configured. This is usually language=0

Returns
SiteLanguage

Implements TYPO3\CMS\Core\Site\Entity\SiteInterface.

Definition at line 131 of file NullSite.php.

◆ getErrorHandler()

PageErrorHandlerInterface TYPO3\CMS\Core\Site\Entity\NullSite::getErrorHandler ( int  $statusCode)

Returns a ready-to-use error handler, to be used within the ErrorController

Parameters
int$statusCode
Returns
‪PageErrorHandlerInterface
Exceptions

Implements TYPO3\CMS\Core\Site\Entity\SiteInterface.

Definition at line 190 of file NullSite.php.

◆ getIdentifier()

string TYPO3\CMS\Core\Site\Entity\NullSite::getIdentifier ( )

Returns always #NULL

Returns
‪string

Implements TYPO3\CMS\Core\Site\Entity\SiteInterface.

Definition at line 77 of file NullSite.php.

Referenced by TYPO3\CMS\Core\Site\Entity\NullSite\getLanguageById().

◆ getLanguageById()

SiteLanguage TYPO3\CMS\Core\Site\Entity\NullSite::getLanguageById ( int  $languageId)

Returns a language of this site, given by the sys_language_uid

Parameters
int$languageId
Returns
SiteLanguage
Exceptions

Implements TYPO3\CMS\Core\Site\Entity\SiteInterface.

Definition at line 117 of file NullSite.php.

References TYPO3\CMS\Core\Site\Entity\NullSite\getIdentifier().

◆ getLanguages()

SiteLanguage [] TYPO3\CMS\Core\Site\Entity\NullSite::getLanguages ( )

Returns all available languages of this installation

Returns
SiteLanguage[]

Implements TYPO3\CMS\Core\Site\Entity\SiteInterface.

Definition at line 105 of file NullSite.php.

References TYPO3\CMS\Core\Site\Entity\NullSite\$languages.

◆ getLanguageService()

LanguageService TYPO3\CMS\Core\Site\Entity\NullSite::getLanguageService ( )
protected

Shorthand functionality for fetching the language service

Returns
‪LanguageService

Definition at line 199 of file NullSite.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\Site\Entity\NullSite\getAvailableLanguages().

◆ getRootPageId()

int TYPO3\CMS\Core\Site\Entity\NullSite::getRootPageId ( )

Always zero

Returns
‪int

Implements TYPO3\CMS\Core\Site\Entity\SiteInterface.

Definition at line 95 of file NullSite.php.

Member Data Documentation

◆ $languages

SiteLanguage [] TYPO3\CMS\Core\Site\Entity\NullSite::$languages
protected

◆ $rootPageId

int TYPO3\CMS\Core\Site\Entity\NullSite::$rootPageId = 0
protected

Definition at line 35 of file NullSite.php.