PHP Class Translation

Exibir arquivo Open project: sourcefabric/newscoop Class Usage Examples

Public Properties

Property Type Description
$m_columnNames
$m_dbTableName
$m_keyColumnNames
$m_keyIsAutoIncrement

Public Methods

Method 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

Method Description
__GeneratePhraseId ( ) Create a unique identifier for a phrase.

Method Details

GetPhrase() public static method

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 method

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
return array

SetPhrase() public static method

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

Translation() public method

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

create() public method

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.
return boolean

deletePhrase() public method

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 method

Get the language ID.
public getLanguageId ( ) : integer
return integer

getPhraseId() public method

Get the phrase ID.
public getPhraseId ( ) : integer
return integer

getText() public method

Get the text.
public getText ( ) : string
return string

setText() public method

Set the translation text.
public setText ( string $p_value ) : boolean
$p_value string
return 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