Language
in package

This is the Language class.

The purpose of this class is to encapsulate the information of the language sheet of the set language.

Tags
see
Language::getInstance()
see
Language::reloadInstance()
see
Language::resetInstance()
see
Language::getLanguageSheet()
see
Language::getLabelValue()
see
Language::defineLanguageSheet()
see
Language::getLanguage()

Table of Contents

$languageSheet  : array<string|int, mixed>|null
getInstance() This method returns the Language instance (singleton).  : Language
getLabelValue() This method returns the value of the specified label of the language sheet.  : string
getLanguage() This method returns the language identifier.  : string
getLanguageSheet() This method returns the languageSheet.  : array<string|int, mixed>
resetInstance() This method unsets the Language instance.  : void
defineLanguageSheet() This method returns the languageSheet.  : array<string|int, mixed>

Properties

$languageSheet

protected array<string|int, mixed>|null $languageSheet = null

Methods

getInstance()

This method returns the Language instance (singleton).

public final static getInstance([string $language = DEFAULT_ROUTE[RouteItems::LANGUAGE] ]) : Language

The singleton instance is created initializating its language to the one set in the session and its corresponding languageSheet.

Parameters
$language : string = DEFAULT_ROUTE[RouteItems::LANGUAGE]
Return values
Language —

getLabelValue()

This method returns the value of the specified label of the language sheet.

public getLabelValue(string $label[, string $defaultValue = '' ]) : string
Parameters
$label : string

Label to get its value from the language sheet.

$defaultValue : string = ''

Value to return in case the label is not set in the language sheet. If this param is not specified the considered default value is ''.

Return values
string —

getLanguage()

This method returns the language identifier.

public getLanguage() : string
Return values
string —

getLanguageSheet()

This method returns the languageSheet.

public getLanguageSheet() : array<string|int, mixed>
Return values
array<string|int, mixed> —

resetInstance()

This method unsets the Language instance.

public final static resetInstance() : void
Return values
void —

defineLanguageSheet()

This method returns the languageSheet.

protected defineLanguageSheet() : array<string|int, mixed>
Return values
array<string|int, mixed> —

Search results