Translation::GetPhrase PHP Method

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
    public static function GetPhrase($p_languageId, $p_phraseId)
    {
        global $g_ado_db;
        $sql = "SELECT translation_text FROM Translations" . " WHERE phrase_id=" . $p_phraseId . " AND fk_language_id=" . $p_languageId;
        return $g_ado_db->GetOne($sql);
    }

Usage Example

Example #1
0
 /**
  * Get the description in the given language.
  * This is a convenience function that wraps the Translation::GetPhrase() function.
  *
  * @param int $p_languageId
  * @return string
  */
 public function getDescription($p_languageId)
 {
     return Translation::GetPhrase($p_languageId, $this->m_data['fk_description_id']);
 }