MediaWiki  master
DataUpdate.php
Go to the documentation of this file.
1 <?php
28 abstract class DataUpdate implements DeferrableUpdate {
30  protected $ticket;
32  protected $causeAction = 'unknown';
34  protected $causeAgent = 'unknown';
35 
36  public function __construct() {
37  // noop
38  }
39 
44  public function setTransactionTicket( $ticket ) {
45  $this->ticket = $ticket;
46  }
47 
52  public function setCause( $action, $user ) {
53  $this->causeAction = $action;
54  $this->causeAgent = $user;
55  }
56 
60  public function getCauseAction() {
61  return $this->causeAction;
62  }
63 
67  public function getCauseAgent() {
68  return $this->causeAgent;
69  }
70 
78  public static function runUpdates( array $updates ) {
79  foreach ( $updates as $update ) {
80  $update->doUpdate();
81  }
82  }
83 }
mixed $ticket
Result from LBFactory::getEmptyTransactionTicket()
Definition: DataUpdate.php:30
static runUpdates(array $updates)
Convenience method, calls doUpdate() on every DataUpdate in the array.
Definition: DataUpdate.php:78
string $causeAction
Short update cause action description.
Definition: DataUpdate.php:32
setCause( $action, $user)
Definition: DataUpdate.php:52
setTransactionTicket( $ticket)
Definition: DataUpdate.php:44
getCauseAction()
Definition: DataUpdate.php:60
string $causeAgent
Short update cause user description.
Definition: DataUpdate.php:34