[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/i18n/ -> sfMessageSource_MySQL.class.php (sommaire)

sfMessageSource_MySQL class file. This program is free software; you can redistribute it and/or modify it under the terms of the BSD License.

Author: Wei Zhuo
Version: $Id: sfMessageSource_MySQL.class.php 3148 2007-01-04 19:34:28Z fabien $
Poids: 453 lignes (11 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

sfMessageSource_MySQL:: (14 méthodes):
  __construct()
  __destruct()
  connect()
  connection()
  loadData()
  getLastModified()
  isValidSource()
  getCatalogueList()
  getCatalogueDetails()
  updateCatalogueTime()
  save()
  delete()
  update()
  catalogues()


Classe: sfMessageSource_MySQL  - X-Ref

sfMessageSource_MySQL class.

Retrieve the message translation from a MySQL database.

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

__construct($source)   X-Ref
Constructor.
Create a new message source using MySQL.

param: string MySQL datasource, in PEAR's DB DSN format.

__destruct()   X-Ref
Destructor, close the database connection.


connect()   X-Ref
Connect to the MySQL datasource

return: resource MySQL connection.

connection()   X-Ref
Get the database connection.

return: db database connection.

loadData($variant)   X-Ref
Get an array of messages for a particular catalogue and cultural
variant.

param: string the catalogue name + variant
return: array translation messages.

getLastModified($source)   X-Ref
Get the last modified unix-time for this particular catalogue+variant.
We need to query the database to get the date_modified.

param: string catalogue+variant
return: int last modified in unix-time format.

isValidSource($variant)   X-Ref
Check if a particular catalogue+variant exists in the database.

param: string catalogue+variant
return: boolean true if the catalogue+variant is in the database, false otherwise.

getCatalogueList($catalogue)   X-Ref
Get all the variants of a particular catalogue.

param: string catalogue name
return: array list of all variants for this catalogue.

getCatalogueDetails($catalogue = 'messages')   X-Ref
Retrieve catalogue details, array($cat_id, $variant, $count).

param: string catalogue
return: array catalogue details, array($cat_id, $variant, $count).

updateCatalogueTime($cat_id, $variant)   X-Ref
Update the catalogue last modified time.

return: boolean true if updated, false otherwise.

save($catalogue = 'messages')   X-Ref
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 <b>append()</b> method.

param: string the catalogue to add to
return: boolean true if saved successfuly, false otherwise.

delete($message, $catalogue = 'messages')   X-Ref
Delete a particular message from the specified catalogue.

param: string the source message to delete.
param: string the catalogue to delete from.
return: boolean true if deleted, false otherwise.

update($text, $target, $comments, $catalogue = 'messages')   X-Ref
Update the translation.

param: string the source string.
param: string the new translation string.
param: string comments
param: string the catalogue of the translation.
return: boolean true if translation was updated, false otherwise.

catalogues()   X-Ref
Returns a list of catalogue as key and all it variants as value.

return: array list of catalogues



Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7