Prado\I18N\core\MessageSource_MySQL::update PHP Метод

update() публичный Метод

Update the translation.
public update ( $text, $target, $comments, $catalogue = 'messages' ) : boolean
Результат boolean true if translation was updated, false otherwise.
    function update($text, $target, $comments, $catalogue = 'messages')
    {
        $details = $this->getCatalogueDetails($catalogue);
        if ($details) {
            list($cat_id, $variant, $count) = $details;
        } else {
            return false;
        }
        $comments = mysql_real_escape_string($comments);
        $target = mysql_real_escape_string($target);
        $text = mysql_real_escape_string($text);
        $time = time();
        $statement = "UPDATE trans_unit SET\n\t\t\t\t\t\ttarget = '{$target}',\n\t\t\t\t\t\tcomments = '{$comments}',\n\t\t\t\t\t\tdate_modified = '{$time}'\n\t\t\t\t\tWHERE cat_id = {$cat_id}\n\t\t\t\t\t\tAND source = '{$text}'";
        $updated = false;
        mysql_query($statement, $this->db);
        if (mysql_affected_rows($this->db) == 1) {
            $updated = $this->updateCatalogueTime($cat_id, $variant);
        }
        return $updated;
    }