Debian Codegraph @

includes/deferred/TransactionRoundDefiningUpdate.php

raw symbols SCIP
1 <?php
2
3 namespace MediaWiki\Deferred;
4
5 use Wikimedia\Rdbms\Platform\ISQLPlatform;
6
7 /**
8 * Deferrable update that must run outside of any explicit LBFactory transaction round
9 *
10 * @since 1.31
11 */
12 class TransactionRoundDefiningUpdate
13 implements DeferrableUpdate, DeferrableCallback, TransactionRoundAwareUpdate
14 {
15 /** @var callable|null */
16 private $callback;
17 /** @var string */
18 private $fname;
19
20 /**
21 * @param callable $callback
22 * @param string $fname Calling method @phan-mandatory-param
23 */
24 public function __construct( callable $callback, $fname = ISQLPlatform::CALLER_UNKNOWN ) {
25 $this->callback = $callback;
26 $this->fname = $fname;
27 }
28
29 public function doUpdate() {
30 call_user_func( $this->callback );
31 }
32
33 public function getOrigin() {
34 return $this->fname;
35 }
36
37 /**
38 * @return int One of the class TRX_ROUND_* constants
39 * @since 1.34
40 */
41 final public function getTransactionRoundRequirement() {
42 return self::TRX_ROUND_ABSENT;
43 }
44 }
45
46 /** @deprecated class alias since 1.42 */
47 class_alias( TransactionRoundDefiningUpdate::class, 'TransactionRoundDefiningUpdate' );