$database→savepointCreate()

Create a savepoint in the active transaction, which savepointRollback() can undo to while the rest continues

Available since version 3.0.274.

Example

$database->savepointCreate('my_step');
try {
  // queries that may fail
  $database->savepointRelease('my_step');
} catch(\Exception $e) {
  $database->savepointRollback('my_step'); // undo just those, the transaction continues
}

Usage

$bool = $database->savepointCreate(string $name);

Arguments

NameType(s)Description
$namestring

Letters, digits and underscores

Return value

bool

False if not in a transaction (and no savepoint was created)


$database methods and properties

API reference based on ProcessWire core version 3.0.275