Documentation

Manager
in package

Tags
copyright

CiviCRM LLC https://civicrm.org/licensing

Table of Contents

Properties

$dao  : CRM_Core_DAO
$frames  : array<string|int, Frame>
Stack of SQL transactions/savepoints.
$savePointCount  : int
$singleton  : mixed

Methods

__construct()  : mixed
dec()  : mixed
Decrement the transaction count / close out a transaction level
forceRollback()  : mixed
Force an immediate rollback, regardless of how many transaction or frame objects exist.
getBaseFrame()  : Frame
Get the (outermost) SQL transaction (i.e. the one demarcated by BEGIN/COMMIT/ROLLBACK)
getFrame()  : Frame
Get the (innermost) SQL transaction.
inc()  : mixed
Increment the transaction count / add a new transaction level
singleton()  : Manager
createBaseFrame()  : Frame
createSavePoint()  : Frame

Properties

$frames

Stack of SQL transactions/savepoints.

private array<string|int, Frame> $frames = []

$savePointCount

private int $savePointCount = 0

$singleton

private static mixed $singleton = NULL

Methods

__construct()

public __construct(CRM_Core_DAO $dao) : mixed
Parameters
$dao : CRM_Core_DAO

Handle for the DB connection that will execute transaction statements. (all we really care about is the query() function)

forceRollback()

Force an immediate rollback, regardless of how many transaction or frame objects exist.

public forceRollback() : mixed

This is only appropriate when it is certain that the callstack will not wind-down normally -- e.g. before a call to exit().

getBaseFrame()

Get the (outermost) SQL transaction (i.e. the one demarcated by BEGIN/COMMIT/ROLLBACK)

public getBaseFrame() : Frame
Return values
Frame

getFrame()

Get the (innermost) SQL transaction.

public getFrame() : Frame
Return values
Frame

inc()

Increment the transaction count / add a new transaction level

public inc([bool $nest = FALSE ]) : mixed
Parameters
$nest : bool = FALSE

Determines what to do if there's currently an active transaction:.

  • If true, then make a new nested transaction ("SAVEPOINT")
  • If false, then attach to the existing transaction

singleton()

public static singleton([bool $fresh = FALSE ]) : Manager
Parameters
$fresh : bool = FALSE
Return values
Manager

        
On this page

Search results