eZPublishCommunityProject  2012.12
eZ\Publish\Core\REST\Client\LanguageService Class Reference

Implementation of the eZ\Publish\API\Repository\LanguageServiceinterface. More...

+ Inheritance diagram for eZ\Publish\Core\REST\Client\LanguageService:
+ Collaboration diagram for eZ\Publish\Core\REST\Client\LanguageService:

Public Member Functions

 __construct (ContentService $contentService, $defaultLanguageCode, HttpClient $client, Dispatcher $inputDispatcher, Visitor $outputVisitor, UrlHandler $urlHandler)
 
 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...
 
 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...
 
 setSession ($id)
 Set session ID. More...
 
 updateLanguageName (Language $language, $newName)
 Changes the name of the language in the content repository. More...
 

Private Attributes

 $client
 
 $contentService
 
 $defaultLanguageCode
 
 $inputDispatcher
 
 $outputVisitor
 
 $urlHandler
 

Detailed Description

Implementation of the eZ\Publish\API\Repository\LanguageServiceinterface.

See Also

Constructor & Destructor Documentation

eZ\Publish\Core\REST\Client\LanguageService::__construct ( ContentService  $contentService,
  $defaultLanguageCode,
HttpClient  $client,
Dispatcher  $inputDispatcher,
Visitor  $outputVisitor,
UrlHandler  $urlHandler 
)
Parameters
\eZ\Publish\Core\REST\Client\HttpClient$client
\eZ\Publish\Core\REST\Common\Input\Dispatcher$inputDispatcher
\eZ\Publish\Core\REST\Common\Output\Visitor$outputVisitor
\eZ\Publish\Core\REST\Common\UrlHandler$urlHandler

Member Function Documentation

eZ\Publish\Core\REST\Client\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\REST\Client\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\REST\Client\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

Implements eZ\Publish\API\Repository\LanguageService.

eZ\Publish\Core\REST\Client\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

Implements eZ\Publish\API\Repository\LanguageService.

eZ\Publish\Core\REST\Client\LanguageService::getDefaultLanguageCode ( )

Returns a configured default language code.

Returns
string

Implements eZ\Publish\API\Repository\LanguageService.

eZ\Publish\Core\REST\Client\LanguageService::loadLanguage (   $languageCode)

Loads a Language from its language code ($languageCode)

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

Implements eZ\Publish\API\Repository\LanguageService.

eZ\Publish\Core\REST\Client\LanguageService::loadLanguageById (   $languageId)

Loads a Language by its id ($languageId)

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

Implements eZ\Publish\API\Repository\LanguageService.

eZ\Publish\Core\REST\Client\LanguageService::loadLanguages ( )

Loads all Languages.

Returns
[]

Implements eZ\Publish\API\Repository\LanguageService.

eZ\Publish\Core\REST\Client\LanguageService::newLanguageCreateStruct ( )

Instantiates an object to be used for creating languages.

Returns

Implements eZ\Publish\API\Repository\LanguageService.

eZ\Publish\Core\REST\Client\LanguageService::setSession (   $id)

Set session ID.

Only for testing

Parameters
mixedtringid
Returns
void

Implements eZ\Publish\Core\REST\Client\Sessionable.

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

Changes the name of the language in the content repository.

Exceptions
\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\REST\Client\LanguageService::$client
private
eZ\Publish\Core\REST\Client\LanguageService::$contentService
private
eZ\Publish\Core\REST\Client\LanguageService::$defaultLanguageCode
private
eZ\Publish\Core\REST\Client\LanguageService::$inputDispatcher
private
eZ\Publish\Core\REST\Client\LanguageService::$outputVisitor
private
eZ\Publish\Core\REST\Client\LanguageService::$urlHandler
private

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