You are here

function DB_pgsql::rollback in Flickr API 5

Reverts the current transaction

Return value

int DB_OK on success. A DB_Error object on failure.

Overrides DB_common::rollback

File

phpFlickr/PEAR/DB/pgsql.php, line 628

Class

DB_pgsql
The methods PEAR DB uses to interact with PHP's pgsql extension for interacting with PostgreSQL databases

Code

function rollback() {
  if ($this->transaction_opcount > 0) {
    $result = @pg_exec($this->connection, 'abort;');
    $this->transaction_opcount = 0;
    if (!$result) {
      return $this
        ->pgsqlRaiseError();
    }
  }
  return DB_OK;
}