22 private $trxRoundRequirement = self::TRX_ROUND_PRESENT;
36 $fname = ISQLPlatform::CALLER_UNKNOWN,
39 $this->callback = $callback;
40 $this->fname = $fname;
42 $dependeeDbws = is_array( $dependeeDbws ) ? $dependeeDbws : [ $dependeeDbws ];
43 foreach ( $dependeeDbws as $dbw ) {
44 if ( $dbw->trxLevel() ) {
45 $dbw->onTransactionResolution( [ $this,
'cancelOnRollback' ], $fname );
51 if ( $this->callback instanceof Closure ) {
52 ( $this->callback )( $this->fname );
53 } elseif ( $this->callback ) {
56 ( $this->callback )();
65 if ( $trigger === IDatabase::TRIGGER_ROLLBACK ) {
66 $this->callback =
null;
78 $this->trxRoundRequirement = $mode;
82 return $this->trxRoundRequirement;
87class_alias( MWCallableUpdate::class,
'MWCallableUpdate' );