MediaWiki  1.33.0
AutoCommitUpdate Class Reference

Deferrable Update for closure/callback updates that should use auto-commit mode. More...

Inheritance diagram for AutoCommitUpdate:
Collaboration diagram for AutoCommitUpdate:

Public Member Functions

 __construct (IDatabase $dbw, $fname, callable $callback, array $conns=[])
 cancelOnRollback ( $trigger)
 doUpdate ()
 Perform the actual work. More...
 getOrigin ()

Private Attributes

callable null $callback
IDatabase $dbw
string $fname

Detailed Description

Deferrable Update for closure/callback updates that should use auto-commit mode.


Definition at line 9 of file AutoCommitUpdate.php.

Constructor & Destructor Documentation

◆ __construct()

AutoCommitUpdate::__construct ( IDatabase  $dbw,
callable  $callback,
array  $conns = [] 
IDatabase$dbwDB handle; update aborts if a transaction now this rolls back
string$fnameCaller name (usually METHOD)
callable$callbackCallback that takes (IDatabase, method name string)
IDatabase[]$connsAbort if a transaction now on one of these rolls back [optional]

Definition at line 23 of file AutoCommitUpdate.php.

References $callback, $dbw, $fname, as, and Wikimedia\Rdbms\IDatabase\onTransactionResolution().

Member Function Documentation

◆ cancelOnRollback()

AutoCommitUpdate::cancelOnRollback (   $trigger)
Access:\n private This method is public so that it works with onTransactionResolution()

Definition at line 61 of file AutoCommitUpdate.php.

◆ doUpdate()

AutoCommitUpdate::doUpdate ( )

Perform the actual work.

Implements DeferrableUpdate.

Definition at line 36 of file AutoCommitUpdate.php.

References $callback, $e, and DBO_TRX.

◆ getOrigin()

AutoCommitUpdate::getOrigin ( )
string Originating method name

Implements DeferrableCallback.

Definition at line 67 of file AutoCommitUpdate.php.

References $fname.

Member Data Documentation

◆ $callback

callable null AutoCommitUpdate::$callback

Definition at line 15 of file AutoCommitUpdate.php.

Referenced by __construct(), and doUpdate().

◆ $dbw

IDatabase AutoCommitUpdate::$dbw

Definition at line 11 of file AutoCommitUpdate.php.

Referenced by __construct().

◆ $fname

string AutoCommitUpdate::$fname

Definition at line 13 of file AutoCommitUpdate.php.

Referenced by __construct(), and getOrigin().

The documentation for this class was generated from the following file: