Documentation

Frame
in package

A "frame" is a layer in a series of nested transactions. Generally, the outermost frame is a normal SQL transaction (BEGIN/ROLLBACK/COMMIT) and any nested frames are SQL savepoints (SAVEPOINT foo/ROLLBACK TO SAVEPOINT).

Tags
copyright

CiviCRM LLC https://civicrm.org/licensing

Table of Contents

Constants

F_ACTIVE  = 1
F_DONE  = 2
F_FORCED  = 3
F_NEW  = 0

Properties

$beginStmt  : string|null
The statement used to start this transaction - e.g. "BEGIN" or "SAVEPOINT foo"
$callbacks  : mixed
$commitStmt  : string|null
The statement used to commit this transaction - e.g. "COMMIT"
$dao  : CRM_Core_DAO
$doCommit  : mixed
$refCount  : int
$rollbackStmt  : string|null
The statement used to rollback this transaction - e.g. "ROLLBACK" or "ROLLBACK TO SAVEPOINT foo"
$state  : int

Methods

__construct()  : mixed
addCallback()  : mixed
Add a transaction callback.
begin()  : mixed
Begin frame processing.
dec()  : mixed
finish()  : mixed
Finish frame processing.
forceRollback()  : mixed
inc()  : mixed
invokeCallbacks()  : mixed
isEmpty()  : bool
isRollbackOnly()  : bool
setRollbackOnly()  : mixed

Constants

F_ACTIVE

public mixed F_ACTIVE = 1

F_DONE

public mixed F_DONE = 2

F_FORCED

public mixed F_FORCED = 3

F_NEW

public mixed F_NEW = 0

Properties

$beginStmt

The statement used to start this transaction - e.g. "BEGIN" or "SAVEPOINT foo"

private string|null $beginStmt

$callbacks

private mixed $callbacks

$commitStmt

The statement used to commit this transaction - e.g. "COMMIT"

private string|null $commitStmt

$doCommit

private mixed $doCommit = TRUE

$refCount

private int $refCount = 0

$rollbackStmt

The statement used to rollback this transaction - e.g. "ROLLBACK" or "ROLLBACK TO SAVEPOINT foo"

private string|null $rollbackStmt

$state

private int $state = self::F_NEW

Methods

__construct()

public __construct(CRM_Core_DAO $dao, string|null $beginStmt, string|null $commitStmt, string|null $rollbackStmt) : mixed
Parameters
$dao : CRM_Core_DAO
$beginStmt : string|null

e.g. "BEGIN" or "SAVEPOINT foo"

$commitStmt : string|null

e.g. "COMMIT"

$rollbackStmt : string|null

e.g. "ROLLBACK" or "ROLLBACK TO SAVEPOINT foo"

addCallback()

Add a transaction callback.

public addCallback(int $phase, callable $callback[, mixed $params = NULL ][, string|int|null $id = NULL ]) : mixed

Pre-condition: isActive()

Parameters
$phase : int

A constant; one of: self::PHASE_{PRE,POST}_{COMMIT,ROLLBACK}.

$callback : callable

A PHP callback.

$params : mixed = NULL

Optional values to pass to callback. See php manual call_user_func_array for details.

$id : string|int|null = NULL

finish()

Finish frame processing.

public finish([int $newState = self::F_DONE ]) : mixed
Parameters
$newState : int = self::F_DONE
Tags
throws
CRM_Core_Exception

forceRollback()

public forceRollback() : mixed

invokeCallbacks()

public invokeCallbacks(int $phase) : mixed
Parameters
$phase : int

isEmpty()

public isEmpty() : bool
Return values
bool

isRollbackOnly()

public isRollbackOnly() : bool
Return values
bool

setRollbackOnly()

public setRollbackOnly() : mixed

        
On this page

Search results