eZPublishCommunityProject  2012.12
eZ\Publish\Core\Repository\LanguageService Class Reference
+ Inheritance diagram for eZ\Publish\Core\Repository\LanguageService:
+ Collaboration diagram for eZ\Publish\Core\Repository\LanguageService:

Public Member Functions

 __construct (RepositoryInterface $repository, Handler $languageHandler, array $settings=array())
 Setups service with reference to repository object that created it & corresponding handler. More...
 
 createLanguage (LanguageCreateStruct $languageCreateStruct)
 Creates the a new Language in the content repository. More...
 
 deleteLanguage (Language $language)
 Deletes a language from content repository. More...
 
 disableLanguage (Language $language)
 Disables a language. More...
 
 enableLanguage (Language $language)
 Enables a language. More...
 
 getDefaultLanguageCode ()
 Returns a configured default language code. More...
 
 getPrioritizedLanguageCodeList ()
 Returns a configured list of prioritized languageCodes. More...
 
 loadLanguage ($languageCode)
 Loads a Language from its language code ($languageCode) More...
 
 loadLanguageById ($languageId)
 Loads a Language by its id ($languageId) More...
 
 loadLanguages ()
 Loads all Languages. More...
 
 newLanguageCreateStruct ()
 Instantiates an object to be used for creating languages. More...
 
 updateLanguageName (Language $language, $newName)
 Changes the name of the language in the content repository. More...
 

Protected Member Functions

 buildDomainObject (SPILanguage $spiLanguage)
 Builds Language domain object from ValueObject returned by Persistence API. More...
 

Protected Attributes

 $languageHandler
 
 $repository
 
 $settings
 

Constructor & Destructor Documentation

eZ\Publish\Core\Repository\LanguageService::__construct ( RepositoryInterface  $repository,
Handler  $languageHandler,
array  $settings = array() 
)

Setups service with reference to repository object that created it & corresponding handler.

Parameters
\eZ\Publish\API\Repository\Repository$repository
\eZ\Publish\SPI\Persistence\Content\Language\Handler$languageHandler
array$settings

Member Function Documentation

eZ\Publish\Core\Repository\LanguageService::buildDomainObject ( SPILanguage  $spiLanguage)
protected
eZ\Publish\Core\Repository\LanguageService::createLanguage ( LanguageCreateStruct  $languageCreateStruct)

Creates the a new Language in the content repository.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf user does not have access to content translations
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif the languageCode already exists
Parameters
\eZ\Publish\API\Repository\Values\Content\LanguageCreateStruct$languageCreateStruct
Returns

Implements eZ\Publish\API\Repository\LanguageService.

eZ\Publish\Core\Repository\LanguageService::deleteLanguage ( Language  $language)

Deletes a language from content repository.

Exceptions
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif language can not be deleted because it is still assigned to some content / type / (...).
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf user does not have access to content translations
Parameters
\eZ\Publish\API\Repository\Values\Content\Language$language

Implements eZ\Publish\API\Repository\LanguageService.

eZ\Publish\Core\Repository\LanguageService::disableLanguage ( Language  $language)

Disables a language.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf user does not have access to content translations
Parameters
\eZ\Publish\API\Repository\Values\Content\Language$language
Returns

Implements eZ\Publish\API\Repository\LanguageService.

eZ\Publish\Core\Repository\LanguageService::enableLanguage ( Language  $language)

Enables a language.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf user does not have access to content translations
Parameters
\eZ\Publish\API\Repository\Values\Content\Language$language
Returns

Implements eZ\Publish\API\Repository\LanguageService.

eZ\Publish\Core\Repository\LanguageService::getDefaultLanguageCode ( )

Returns a configured default language code.

Returns
string

Implements eZ\Publish\API\Repository\LanguageService.

eZ\Publish\Core\Repository\LanguageService::getPrioritizedLanguageCodeList ( )

Returns a configured list of prioritized languageCodes.

private This is currently only for internal use in Services

Returns
string[]
eZ\Publish\Core\Repository\LanguageService::loadLanguage (   $languageCode)

Loads a Language from its language code ($languageCode)

Exceptions
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif languageCode argument is not string
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionif language could not be found
Parameters
string$languageCode
Returns

Implements eZ\Publish\API\Repository\LanguageService.

Referenced by eZ\Publish\Core\Repository\LanguageService\createLanguage().

eZ\Publish\Core\Repository\LanguageService::loadLanguageById (   $languageId)

Loads a Language by its id ($languageId)

Exceptions
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif languageId argument is not integer
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionif language could not be found
Parameters
int$languageId
Returns

Implements eZ\Publish\API\Repository\LanguageService.

Referenced by eZ\Publish\Core\Repository\LanguageService\deleteLanguage(), eZ\Publish\Core\Repository\LanguageService\disableLanguage(), eZ\Publish\Core\Repository\LanguageService\enableLanguage(), and eZ\Publish\Core\Repository\LanguageService\updateLanguageName().

eZ\Publish\Core\Repository\LanguageService::loadLanguages ( )

Loads all Languages.

Returns
[]

Implements eZ\Publish\API\Repository\LanguageService.

eZ\Publish\Core\Repository\LanguageService::newLanguageCreateStruct ( )

Instantiates an object to be used for creating languages.

Returns

Implements eZ\Publish\API\Repository\LanguageService.

eZ\Publish\Core\Repository\LanguageService::updateLanguageName ( Language  $language,
  $newName 
)

Changes the name of the language in the content repository.

Exceptions
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif languageCode argument is not string
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionIf user does not have access to content translations
Parameters
\eZ\Publish\API\Repository\Values\Content\Language$language
string$newName
Returns

Implements eZ\Publish\API\Repository\LanguageService.

Member Data Documentation

eZ\Publish\Core\Repository\LanguageService::$languageHandler
protected
eZ\Publish\Core\Repository\LanguageService::$repository
protected
eZ\Publish\Core\Repository\LanguageService::$settings
protected

The documentation for this class was generated from the following file: