Interface

eZ\Publish\API\Repository\LanguageService

interface LanguageService

Language service, used for language operations.

Methods

Language createLanguage(LanguageCreateStruct $languageCreateStruct)

Creates the a new Language in the content repository.

Language updateLanguageName(Language $language, string $newName)

Changes the name of the language in the content repository.

Language enableLanguage(Language $language)

Enables a language.

Language disableLanguage(Language $language)

Disables a language.

Language loadLanguage(string $languageCode)

Loads a Language from its language code ($languageCode).

Language[] loadLanguages()

Loads all Languages.

Language loadLanguageById(mixed $languageId)

Loads a Language by its id ($languageId).

deleteLanguage(Language $language)

Deletes a language from content repository.

string getDefaultLanguageCode()

Returns a configured default language code.

LanguageCreateStruct newLanguageCreateStruct()

Instantiates an object to be used for creating languages.

Details

at line 29
public Language createLanguage(LanguageCreateStruct $languageCreateStruct)

Creates the a new Language in the content repository.

Parameters

LanguageCreateStruct $languageCreateStruct

Return Value

Language

Exceptions

UnauthorizedException If user does not have access to content translations
InvalidArgumentException if the languageCode already exists

at line 41
public Language updateLanguageName(Language $language, string $newName)

Changes the name of the language in the content repository.

Parameters

Language $language
string $newName

Return Value

Language

Exceptions

UnauthorizedException If user does not have access to content translations

at line 52
public Language enableLanguage(Language $language)

Enables a language.

Parameters

Language $language

Return Value

Language

Exceptions

UnauthorizedException If user does not have access to content translations

at line 63
public Language disableLanguage(Language $language)

Disables a language.

Parameters

Language $language

Return Value

Language

Exceptions

UnauthorizedException If user does not have access to content translations

at line 74
public Language loadLanguage(string $languageCode)

Loads a Language from its language code ($languageCode).

Parameters

string $languageCode

Return Value

Language

Exceptions

NotFoundException if language could not be found

at line 81
public Language[] loadLanguages()

Loads all Languages.

Return Value

Language[]

at line 92
public Language loadLanguageById(mixed $languageId)

Loads a Language by its id ($languageId).

Parameters

mixed $languageId

Return Value

Language

Exceptions

NotFoundException if language could not be found

at line 104
public deleteLanguage(Language $language)

Deletes a language from content repository.

Parameters

Language $language

Exceptions

InvalidArgumentException if language can not be deleted because it is still assigned to some content / type / (...).
UnauthorizedException If user is not allowed to delete a language

at line 111
public string getDefaultLanguageCode()

Returns a configured default language code.

Return Value

string

at line 118
public LanguageCreateStruct newLanguageCreateStruct()

Instantiates an object to be used for creating languages.

Return Value

LanguageCreateStruct