LanguageService
Language service, used for language operations.
Methods¶
createLanguage() ¶
Creates the a new Language in the content repository.
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$languageCreateStruct | LanguageCreateStruct | - | - |
Return values
Tags
deleteLanguage() ¶
Deletes a language from content repository.
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$language | Language | - | - |
Tags
disableLanguage() ¶
Disables a language.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$language | Language | - | - |
Return values
Tags
enableLanguage() ¶
Enables a language.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$language | Language | - | - |
Return values
Tags
getDefaultLanguageCode() ¶
Returns a configured default language code.
|
|
Return values
string
loadLanguage() ¶
Loads a Language from its language code ($languageCode).
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$languageCode | string | - | - |
Return values
Tags
loadLanguageById() ¶
Loads a Language by its id ($languageId).
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$languageId | int | - | - |
Return values
Tags
loadLanguageListByCode() ¶
Bulk-load Languages by language codes.
|
|
Note: it does not throw exceptions on load, just ignores erroneous Languages.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$languageCodes | array<string|int, string> | - | - |
Return values
array<string|int, Language>
list of Languages with language-code as keys
loadLanguageListById() ¶
Bulk-load Languages by ids.
|
|
Note: it does not throw exceptions on load, just ignores erroneous Languages.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$languageIds | array<string|int, int> | - | - |
Return values
array<string|int, Language>
list of Languages with id as keys
loadLanguages() ¶
Loads all Languages.
|
|
Return values
array<string|int, Language>
newLanguageCreateStruct() ¶
Instantiates an object to be used for creating languages.
|
|
Return values
updateLanguageName() ¶
Changes the name of the language in the content repository.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$language | Language | - | - |
$newName | string | - | - |