MediaWiki master
MediaWiki\Deferred\AutoCommitUpdate Class Reference

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

Inherits MediaWiki\Deferred\DeferrableUpdate, and MediaWiki\Deferred\DeferrableCallback.

Collaboration diagram for MediaWiki\Deferred\AutoCommitUpdate:

Public Member Functions

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

Detailed Description

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

Since
1.28

Definition at line 11 of file AutoCommitUpdate.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Deferred\AutoCommitUpdate::__construct ( IDatabase $dbw,
$fname,
callable $callback,
array $conns = [] )
Parameters
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[]$connsCancel the update if a transaction on these connections is rolled back [optional]

Definition at line 26 of file AutoCommitUpdate.php.

References Wikimedia\Rdbms\IDatabase\onTransactionResolution().

Member Function Documentation

◆ cancelOnRollback()

MediaWiki\Deferred\AutoCommitUpdate::cancelOnRollback ( $trigger)
Access: internal
This method is public so that it works with onTransactionResolution()
Parameters
int$trigger

Definition at line 59 of file AutoCommitUpdate.php.

◆ doUpdate()

MediaWiki\Deferred\AutoCommitUpdate::doUpdate ( )

Perform the actual work.

Implements MediaWiki\Deferred\DeferrableUpdate.

Definition at line 39 of file AutoCommitUpdate.php.

References DBO_TRX.

◆ getOrigin()

MediaWiki\Deferred\AutoCommitUpdate::getOrigin ( )
Returns
string Originating method name

Implements MediaWiki\Deferred\DeferrableCallback.

Definition at line 65 of file AutoCommitUpdate.php.


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