Path

ez components / documentation / api reference / 2008.2.3 / translation


eZ Components 2008.2.3

Translation: ezcTranslationContextWrite

[ Tutorial ] [ Linguist format ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Interface: ezcTranslationContextWrite

Common interface for all context writers. [source]
This interface specifies the methods that a backend should implement if it wants to act as a general purpose translation context writer.
For an example see ezcTranslationCacheBackend.

Method Summary

public void deinitWriter( )
Deinitializes the writer
public void initWriter( $locale )
Initializes the writer to write from the locale $locale.
public void storeContext( $context, $data )
Stores the context named $context with the data $data.

Methods

deinitWriter

void deinitWriter( )
Deinitializes the writer
This method should be called after the last context was written to cleanup resources.

Throws

ClassDescription
TranslationException when the writer is not initialized with initWriter().

initWriter

void initWriter( string $locale )
Initializes the writer to write from the locale $locale.
Before starting to writer contexts to the writer, you should call this method to initialize it.

Parameters

Name Type Description
$locale string  

Throws

ClassDescription
TranslationException when the path of the translation and the translation format are not set before this method is called.

storeContext

void storeContext( string $context, $data )
Stores the context named $context with the data $data.
$data must contain the translations data map. This method stores the context that it received to the backend specified storage place.

Parameters

Name Type Description
$context string  
$data array  

Throws

ClassDescription
TranslationException when the writer is not initialized with initWriter().

Last updated: Mon, 11 May 2009