PHP Class Translation

Afficher le fichier Open project: sourcefabric/newscoop Class Usage Examples

Méthodes publiques

Свойство Type Description
$m_columnNames
$m_dbTableName
$m_keyColumnNames
$m_keyIsAutoIncrement

Méthodes publiques

Méthode Description
GetPhrase ( integer $p_languageId, integer $p_phraseId ) A convenience function to just grab a translation.
GetTranslations ( integer $p_phraseId, array $p_sqlOptions = null ) : array Return an array of phrases indexed by language ID.
SetPhrase ( integer $p_languageId, integer $p_phraseId, string $p_text ) Enter description here.
Translation ( $p_languageId = null, $p_phraseId = null )
create ( string $p_text = null ) : boolean Create a translation of a phrase. If the phrase ID is set in the constructor, we assume that the phrase already exists and we are just creating a translation, and not a new phrase.
deletePhrase ( $p_phraseId = null ) Delete the phrase and all of its translations.
getLanguageId ( ) : integer Get the language ID.
getPhraseId ( ) : integer Get the phrase ID.
getText ( ) : string Get the text.
setText ( string $p_value ) : boolean Set the translation text.

Private Methods

Méthode Description
__GeneratePhraseId ( ) Create a unique identifier for a phrase.

Method Details

GetPhrase() public static méthode

A convenience function to just grab a translation.
public static GetPhrase ( integer $p_languageId, integer $p_phraseId )
$p_languageId integer
$p_phraseId integer

GetTranslations() public static méthode

Return an array of phrases indexed by language ID.
public static GetTranslations ( integer $p_phraseId, array $p_sqlOptions = null ) : array
$p_phraseId integer
$p_sqlOptions array
Résultat array

SetPhrase() public static méthode

..
public static SetPhrase ( integer $p_languageId, integer $p_phraseId, string $p_text )
$p_languageId integer
$p_phraseId integer
$p_text string

Translation() public méthode

public Translation ( $p_languageId = null, $p_phraseId = null )

create() public méthode

Create a translation of a phrase. If the phrase ID is set in the constructor, we assume that the phrase already exists and we are just creating a translation, and not a new phrase.
public create ( string $p_text = null ) : boolean
$p_text string Optional. The translation text.
Résultat boolean

deletePhrase() public méthode

This can be called statically or as a member function. If called statically, you must give it an argument.
public deletePhrase ( $p_phraseId = null )

getLanguageId() public méthode

Get the language ID.
public getLanguageId ( ) : integer
Résultat integer

getPhraseId() public méthode

Get the phrase ID.
public getPhraseId ( ) : integer
Résultat integer

getText() public méthode

Get the text.
public getText ( ) : string
Résultat string

setText() public méthode

Set the translation text.
public setText ( string $p_value ) : boolean
$p_value string
Résultat boolean

Property Details

$m_columnNames public_oe property

public $m_columnNames

$m_dbTableName public_oe property

public $m_dbTableName

$m_keyColumnNames public_oe property

public $m_keyColumnNames

$m_keyIsAutoIncrement public_oe property

public $m_keyIsAutoIncrement