Postgres::updateFtsDictionary PHP Метод

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

Alters FTS dictionary or dictionary template
public updateFtsDictionary ( $dictname, $comment, $name )
$dictname The dico's name
$comment The comment
$name The new dico's name
    function updateFtsDictionary($dictname, $comment, $name)
    {
        $status = $this->beginTransaction();
        if ($status != 0) {
            $this->rollbackTransaction();
            return -1;
        }
        $this->fieldClean($dictname);
        $status = $this->setComment('TEXT SEARCH DICTIONARY', $dictname, '', $comment);
        if ($status != 0) {
            $this->rollbackTransaction();
            return -1;
        }
        // Only if the name has changed
        if ($name != $dictname) {
            $f_schema = $this->_schema;
            $this->fieldClean($f_schema);
            $this->fieldClean($name);
            $sql = "ALTER TEXT SEARCH DICTIONARY \"{$f_schema}\".\"{$dictname}\" RENAME TO \"{$name}\"";
            $status = $this->execute($sql);
            if ($status != 0) {
                $this->rollbackTransaction();
                return -1;
            }
        }
        return $this->endTransaction();
    }
Postgres