sfMessageSource_Creole class.
Method Summary
-
array
&($variant)
Get an array of messages for a particular catalogue and cultural
-
array
catalogues()
Returns a list of catalogue as key and all it variants as value.
-
db
connection()
Get the database connection.
-
boolean
delete($message, $catalogue)
Delete a particular message from the specified catalogue.
-
array
getCatalogueDetails($catalogue)
Retrieve catalogue details, array($catId, $variant, $count).
-
int
getLastModified($source)
Get the last modified unix-time for this particular catalogue+variant.
-
boolean
isValidSource($variant)
Check if a particular catalogue+variant exists in the database.
-
boolean
save($catalogue)
Save the list of untranslated blocks to the translation source.
-
boolean
update($text, $target, $comments, $catalogue)
Update the translation.
-
boolean
updateCatalogueTime()
Update the catalogue last modified time.
-
__construct($source)
Constructor.
-
__destruct()
Destructor, close the database connection.
getCatalogueList , getId , parseDSN
& , append , factory , getCache , getCatalogueList , getCulture , getLastModified , getSource , isValidSource , load , read , setCache , setCulture , __construct
Method Details
-
| $variant |
the catalogue name + variant |
Get an array of messages for a particular catalogue and cultural
variant.
returns translation messages.
-
Returns a list of catalogue as key and all it variants as value.
returns list of catalogues
-
Get the database connection.
returns database connection.
-
(boolean) delete ($message, $catalogue)
Browse code
| $message |
the source message to delete. |
| $catalogue |
the catalogue to delete from. |
Delete a particular message from the specified catalogue.
returns true if deleted, false otherwise.
-
(array) getCatalogueDetails ($catalogue)
Browse code
Retrieve catalogue details, array($catId, $variant, $count).
returns catalogue details, array($catId, $variant, $count).
-
(int) getLastModified ($source)
Browse code
| $source |
catalogue+variant |
Get the last modified unix-time for this particular catalogue+variant.
We need to query the database to get the date_modified.
returns last modified in unix-time format.
-
(boolean) isValidSource ($variant)
Browse code
| $variant |
catalogue+variant |
Check if a particular catalogue+variant exists in the database.
returns true if the catalogue+variant is in the database, false otherwise.
-
(boolean) save ($catalogue)
Browse code
| $catalogue |
the catalogue to add to |
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.
returns true if saved successfuly, false otherwise.
-
(boolean) update ($text, $target, $comments, $catalogue)
Browse code
| $text |
the source string. |
| $target |
the new translation string. |
| $comments |
comments |
| $catalogue |
the catalogue of the translation. |
Update the translation.
returns true if translation was updated, false otherwise.
-
(boolean) updateCatalogueTime ()
Browse code
Update the catalogue last modified time.
returns true if updated, false otherwise.
-
| $source |
Creole datasource. |
Constructor.
Create a new message source using Creole.
-
Destructor, close the database connection.
|