Class \Prado\I18N\core\MessageSource_Database
MessageSource_Database class.
Retrive the message translation from a database.
See the MessageSource::factory() method to instantiate this class.
Class hierarchy
Author: Xiang Wei Zhuo <weizhuo[at]gmail[dot]com>
public
|
|
public
|
catalogues() : array<string|int, mixed>
Returns a list of catalogue as key and all it variants as value.
|
public
|
delete(string $message[, string $catalogue = 'messages' ]) : bool
Delete a particular message from the specified catalogue.
|
public
|
|
public
|
save([string $catalogue = 'messages' ]) : bool
Save the list of untranslated blocks to the translation source.
If the translation was not found, you should add those strings to the translation source via the append() method. |
public
|
update(string $text, string $target, string $comments[, string $catalogue = 'messages' ]) : bool
Update the translation.
|
protected
|
|
protected
|
getCatalogueList(string $catalogue) : array<string|int, mixed>
Get all the variants of a particular catalogue.
|
protected
|
getLastModified(string $source) : int
Get the last modified unix-time for this particular catalogue+variant.
We need to query the database to get the date_modified. |
protected
|
isValidSource(string $variant) : bool
Check if a particular catalogue+variant exists in the database.
|
protected
|
loadData(string $variant) : array<string|int, mixed>
Get an array of messages for a particular catalogue and cultural
variant.
|
private
|
getCatalogueDetails([string $catalogue = 'messages' ]) : array<string|int, mixed>
Retrive catalogue details, array($cat_id, $variant, $count).
|
private
|
append, factory, getCache, getCulture, load, read, setCache, setCulture, getCatalogueList, getLastModified, getSource, isValidSource, loadData, __construct |