Class MessageSource_SQLite

Description

MessageSource_SQLite class.

Retrive the message translation from a SQLite database.

See the MessageSource::factory() method to instantiate this class.

Located in /I18N/core/MessageSource_SQLite.php (line 41)

MessageSource
   |
   --MessageSource_SQLite
Variable Summary
string $source
Method Summary
MessageSource_SQLite __construct (string $source)
array catalogues ()
boolean delete (string $message, [string $catalogue = 'messages'])
array getCatalogueList (string $catalogue)
int getLastModified (string $source)
boolean isValidSource (string $variant)
array &loadData (string $variant)
boolean save ([string $catalogue = 'messages'])
boolean update (string $text, string $target, string $comments, [string $catalogue = 'messages'])
Variables
string $source (line 47)

The SQLite datasource, the filename of the database.

  • access: protected

Redefinition of:
MessageSource::$source
The source of message translations.

Inherited Variables

Inherited from MessageSource

MessageSource::$cache
MessageSource::$culture
MessageSource::$messages
MessageSource::$untranslated
Methods
Constructor __construct (line 55)

Constructor.

Create a new message source using SQLite.

  • see: MessageSource::factory();
MessageSource_SQLite __construct (string $source)
  • string $source: SQLite datasource, in PEAR's DB DSN format.
catalogues (line 336)

Returns a list of catalogue as key and all it variants as value.

  • return: list of catalogues
array catalogues ()
delete (line 309)

Delete a particular message from the specified catalogue.

  • return: true if deleted, false otherwise.
boolean delete (string $message, [string $catalogue = 'messages'])
  • string $message: the source message to delete.
  • string $catalogue: the catalogue to delete from.
getCatalogueList (line 143)

Get all the variants of a particular catalogue.

  • return: list of all variants for this catalogue.
  • access: protected
array getCatalogueList (string $catalogue)
  • string $catalogue: catalogue name

Redefinition of:
MessageSource::getCatalogueList()
Get all the variants of a particular catalogue.
getLastModified (line 102)

Get the last modified unix-time for this particular catalogue+variant.

We need to query the database to get the date_modified.

  • return: last modified in unix-time format.
  • access: protected
int getLastModified (string $source)
  • string $source: catalogue+variant

Redefinition of:
MessageSource::getLastModified()
Get the last modified unix-time for this particular catalogue+variant.
isValidSource (line 125)

Check if a particular catalogue+variant exists in the database.

  • return: true if the catalogue+variant is in the database, false otherwise.
  • access: protected
boolean isValidSource (string $variant)
  • string $variant: catalogue+variant

Redefinition of:
MessageSource::isValidSource()
Determine if the source is valid.
loadData (line 67)

Get an array of messages for a particular catalogue and cultural variant.

  • return: translation messages.
  • access: protected
array &loadData (string $variant)
  • string $variant: the catalogue name + variant

Redefinition of:
MessageSource::loadData()
Load the message for a particular catalogue+variant.
save (line 224)

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.

  • return: true if saved successfuly, false otherwise.
boolean save ([string $catalogue = 'messages'])
  • string $catalogue: the catalogue to add to
update (line 270)

Update the translation.

  • return: true if translation was updated, false otherwise.
boolean update (string $text, string $target, string $comments, [string $catalogue = 'messages'])
  • string $text: the source string.
  • string $target: the new translation string.
  • string $comments: comments
  • string $catalogue: the catalogue of the translation.

Inherited Methods

Inherited From MessageSource

MessageSource::append()
MessageSource::factory()
MessageSource::getCache()
MessageSource::getCatalogueList()
MessageSource::getCulture()
MessageSource::getLastModified()
MessageSource::getSource()
MessageSource::isValidSource()
MessageSource::load()
MessageSource::loadData()
MessageSource::read()
MessageSource::setCache()
MessageSource::setCulture()

Documentation generated on Sun, 04 Jun 2006 18:58:30 -0400 by phpDocumentor 1.3.0RC4