Postgres::deleteRow PHP Method

deleteRow() public method

Delete a row from a table
public deleteRow ( $table, $key, $schema = false )
$table The table from which to delete
$key An array mapping column => value to delete
    function deleteRow($table, $key, $schema = false)
    {
        if (!is_array($key)) {
            return -1;
        } else {
            // Begin transaction.  We do this so that we can ensure only one row is
            // deleted
            $status = $this->beginTransaction();
            if ($status != 0) {
                $this->rollbackTransaction();
                return -1;
            }
            if ($schema === false) {
                $schema = $this->_schema;
            }
            $status = $this->delete($table, $key, $schema);
            if ($status != 0 || $this->conn->Affected_Rows() != 1) {
                $this->rollbackTransaction();
                return -2;
            }
            // End transaction
            return $this->endTransaction();
        }
    }
Postgres