Postgres::alterAggregate PHP Method

alterAggregate() public method

Alters an aggregate
public alterAggregate ( $aggrname, $aggrtype, $aggrowner, $aggrschema, $aggrcomment, $newaggrname, $newaggrowner, $newaggrschema, $newaggrcomment ) : -4
$aggrname The actual name of the aggregate
$aggrtype The actual input data type of the aggregate
$aggrowner The actual owner of the aggregate
$aggrschema The actual schema the aggregate belongs to
$aggrcomment The actual comment for the aggregate
$newaggrname The new name of the aggregate
$newaggrowner The new owner of the aggregate
$newaggrschema The new schema where the aggregate will belong to
$newaggrcomment The new comment for the aggregate
return -4
    function alterAggregate($aggrname, $aggrtype, $aggrowner, $aggrschema, $aggrcomment, $newaggrname, $newaggrowner, $newaggrschema, $newaggrcomment)
    {
        // Clean fields
        $this->fieldClean($aggrname);
        $this->fieldClean($aggrtype);
        $this->fieldClean($aggrowner);
        $this->fieldClean($aggrschema);
        $this->fieldClean($newaggrname);
        $this->fieldClean($newaggrowner);
        $this->fieldClean($newaggrschema);
        $this->beginTransaction();
        // Change the owner, if it has changed
        if ($aggrowner != $newaggrowner) {
            $status = $this->changeAggregateOwner($aggrname, $aggrtype, $newaggrowner);
            if ($status != 0) {
                $this->rollbackTransaction();
                return -1;
            }
        }
        // Set the comment, if it has changed
        if ($aggrcomment != $newaggrcomment) {
            $status = $this->setComment('AGGREGATE', $aggrname, '', $newaggrcomment, $aggrtype);
            if ($status) {
                $this->rollbackTransaction();
                return -2;
            }
        }
        // Change the schema, if it has changed
        if ($aggrschema != $newaggrschema) {
            $status = $this->changeAggregateSchema($aggrname, $aggrtype, $newaggrschema);
            if ($status != 0) {
                $this->rollbackTransaction();
                return -3;
            }
        }
        // Rename the aggregate, if it has changed
        if ($aggrname != $newaggrname) {
            $status = $this->renameAggregate($newaggrschema, $aggrname, $aggrtype, $newaggrname);
            if ($status != 0) {
                $this->rollbackTransaction();
                return -4;
            }
        }
        return $this->endTransaction();
    }
Postgres