24 public function __construct( callable $callback, $fname =
'unknown', $dbws = [] ) {
25 $this->callback = $callback;
28 $dbws = is_array( $dbws ) ? $dbws : [ $dbws ];
29 foreach ( $dbws as $dbw ) {
30 if ( $dbw && $dbw->trxLevel() ) {
31 $dbw->onTransactionResolution( [ $this,
'cancelOnRollback' ],
$fname );
37 if ( $this->callback ) {
38 call_user_func( $this->callback );
47 if ( $trigger === IDatabase::TRIGGER_ROLLBACK ) {
48 $this->callback =
null;
61 $this->trxRoundRequirement = $mode;
65 return $this->trxRoundRequirement;
Deferrable Update for closure/callback.
string $fname
Calling method name.
cancelOnRollback( $trigger)
callable null $callback
Callback, or null if it was cancelled.
int $trxRoundRequirement
One of the class TRX_ROUND_* constants.
doUpdate()
Perform the actual work.
setTransactionRoundRequirement( $mode)
getTransactionRoundRequirement()
__construct(callable $callback, $fname='unknown', $dbws=[])
Callback wrapper that has an originating method.
Interface that deferrable updates should implement.
Deferrable update that specifies whether it must run outside of any explicit LBFactory transaction ro...