PHP Класс Prado\I18N\core\MessageSource_Database

Retrive the message translation from a database. See the MessageSource::factory() method to instantiate this class.
Наследование: extends MessageSource
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( $source ) Constructor.
catalogues ( ) : array Returns a list of catalogue as key and all it variants as value.
delete ( $message, $catalogue = 'messages' ) : boolean Delete a particular message from the specified catalogue.
getDbConnection ( ) : TDbConnection
save ( $catalogue = 'messages' ) : boolean Save the list of untranslated blocks to the translation source.
update ( $text, $target, $comments, $catalogue = 'messages' ) : boolean Update the translation.

Защищенные методы

Метод Описание
createDbConnection ( $connectionID ) : TDbConnection Creates the DB connection.
getCatalogueList ( $catalogue ) : array Get all the variants of a particular catalogue.
getLastModified ( $source ) : integer Get the last modified unix-time for this particular catalogue+variant.
isValidSource ( $variant ) : boolean Check if a particular catalogue+variant exists in the database.
loadData ( $variant ) : array Get an array of messages for a particular catalogue and cultural variant.

Приватные методы

Метод Описание
getCatalogueDetails ( $catalogue = 'messages' ) : array Retrive catalogue details, array($cat_id, $variant, $count).
updateCatalogueTime ( $cat_id, $variant ) : boolean Update the catalogue last modified time.

Описание методов

__construct() публичный метод

Create a new message source using a Database
public __construct ( $source )

catalogues() публичный метод

Returns a list of catalogue as key and all it variants as value.
public catalogues ( ) : array
Результат array list of catalogues

createDbConnection() защищенный метод

Creates the DB connection.
protected createDbConnection ( $connectionID ) : TDbConnection
Результат TDbConnection the created DB connection

delete() публичный метод

Delete a particular message from the specified catalogue.
public delete ( $message, $catalogue = 'messages' ) : boolean
Результат boolean true if deleted, false otherwise.

getCatalogueList() защищенный метод

Get all the variants of a particular catalogue.
protected getCatalogueList ( $catalogue ) : array
Результат array list of all variants for this catalogue.

getDbConnection() публичный метод

public getDbConnection ( ) : TDbConnection
Результат TDbConnection the database connection that may be used to retrieve messages.

getLastModified() защищенный метод

We need to query the database to get the date_modified.
protected getLastModified ( $source ) : integer
Результат integer last modified in unix-time format.

isValidSource() защищенный метод

Check if a particular catalogue+variant exists in the database.
protected isValidSource ( $variant ) : boolean
Результат boolean true if the catalogue+variant is in the database, false otherwise.

loadData() защищенный метод

Get an array of messages for a particular catalogue and cultural variant.
protected loadData ( $variant ) : array
Результат array translation messages.

save() публичный метод

If the translation was not found, you should add those strings to the translation source via the append() method.
public save ( $catalogue = 'messages' ) : boolean
Результат boolean true if saved successfuly, false otherwise.

update() публичный метод

Update the translation.
public update ( $text, $target, $comments, $catalogue = 'messages' ) : boolean
Результат boolean true if translation was updated, false otherwise.