Postgres::updateFtsConfiguration PHP Метод

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

Alters FTS configuration
public updateFtsConfiguration ( $cfgname, $comment, $name )
$cfgname The conf's name
$comment A comment on for the conf
$name The new conf name
    function updateFtsConfiguration($cfgname, $comment, $name)
    {
        $status = $this->beginTransaction();
        if ($status != 0) {
            $this->rollbackTransaction();
            return -1;
        }
        $this->fieldClean($cfgname);
        $status = $this->setComment('TEXT SEARCH CONFIGURATION', $cfgname, '', $comment);
        if ($status != 0) {
            $this->rollbackTransaction();
            return -1;
        }
        // Only if the name has changed
        if ($name != $cfgname) {
            $f_schema = $this->_schema;
            $this->fieldClean($f_schema);
            $this->fieldClean($name);
            $sql = "ALTER TEXT SEARCH CONFIGURATION \"{$f_schema}\".\"{$cfgname}\" RENAME TO \"{$name}\"";
            $status = $this->execute($sql);
            if ($status != 0) {
                $this->rollbackTransaction();
                return -1;
            }
        }
        return $this->endTransaction();
    }
Postgres