Zeta Components Manual :: Docs For Class ezcTranslationContextWrite
Translation::ezcTranslationContextWrite
Interface ezcTranslationContextWrite
Common interface for all context writers.
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.
Source for this file: /Translation/src/interfaces/context_write_interface.php
Version: | //autogentag// |
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
Deinitializes the writer
This method should be called after the last context was written to cleanup resources.
Exceptions:
Type | Description |
---|---|
TranslationException |
when the writer is not initialized with initWriter(). |
initWriter
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 |
Exceptions:
Type | Description |
---|---|
TranslationException |
when the path of the translation and the translation format are not set before this method is called. |
storeContext
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 |
Exceptions:
Type | Description |
---|---|
TranslationException |
when the writer is not initialized with initWriter(). |