Translation::SetPhrase PHP Метод

SetPhrase() публичный статический Метод

..
public static SetPhrase ( integer $p_languageId, integer $p_phraseId, string $p_text )
$p_languageId integer
$p_phraseId integer
$p_text string
    public static function SetPhrase($p_languageId, $p_phraseId, $p_text)
    {
        if (!is_numeric($p_languageId) || !is_numeric($p_phraseId) || !is_string($p_text)) {
            return false;
        }
        $translation = new Translation($p_languageId, $p_phraseId);
        if ($translation->exists()) {
            return $translation->setText($p_text);
        } else {
            return $translation->create($p_text);
        }
    }

Usage Example

Пример #1
0
 /**
  * Set the description in the given language.
  *
  * @param int $p_languageId
  * @param string $p_text
  */
 public function setDescription($p_languageId, $p_text)
 {
     Translation::SetPhrase($p_languageId, $this->m_data['fk_description_id'], $p_text);
 }