CoolCMS API

LanguageContext
in package

Table of Contents

Properties

$lang  : int|string|null
$language  : Language|null

Methods

__construct()  : mixed
getLang()  : int|string|null
getLanguage()  : Language|null
getLanguageId()  : int|null
requireLanguageId()  : int
Returns the language id where the caller cannot continue without it (translation, e-mail).
setLang()  : self
setLanguage()  : self

Properties

Methods

__construct()

public __construct(Request $httpRequest) : mixed
Parameters
$httpRequest : Request

getLang()

public getLang() : int|string|null
Return values
int|string|null

getLanguageId()

public getLanguageId() : int|null
Return values
int|null

requireLanguageId()

Returns the language id where the caller cannot continue without it (translation, e-mail).

public requireLanguageId() : int

Presenters always have it: LanguageInitTrait sets it in startup. Passing a null id to getTranslation(int) / sendEmail(int) would end in a TypeError, so a missing language throws here instead.

Return values
int

setLang()

public setLang(int|string|null $lang) : self
Parameters
$lang : int|string|null
Return values
self
On this page

Search results