MediaWiki  master
DataUpdate.php
Go to the documentation of this file.
1 <?php
30 abstract class DataUpdate implements DeferrableUpdate {
32  protected $ticket;
34  protected $causeAction = 'unknown';
36  protected $causeAgent = 'unknown';
37 
41  public function __construct() {
42  // noop
43  }
44 
49  public function setTransactionTicket( $ticket ) {
50  $this->ticket = $ticket;
51  }
52 
57  public function setCause( $action, $user ) {
58  $this->causeAction = $action;
59  $this->causeAgent = $user;
60  }
61 
65  public function getCauseAction() {
66  return $this->causeAction;
67  }
68 
72  public function getCauseAgent() {
73  return $this->causeAgent;
74  }
75 
83  public static function runUpdates( array $updates ) {
84  foreach ( $updates as $update ) {
85  $update->doUpdate();
86  }
87  }
88 }
DataUpdate\getCauseAgent
getCauseAgent()
Definition: DataUpdate.php:72
DataUpdate\$causeAgent
string $causeAgent
Short update cause user description.
Definition: DataUpdate.php:36
DataUpdate\setTransactionTicket
setTransactionTicket( $ticket)
Definition: DataUpdate.php:49
DataUpdate
Abstract base class for update jobs that do something with some secondary data extracted from article...
Definition: DataUpdate.php:30
DataUpdate\$ticket
mixed $ticket
Result from LBFactory::getEmptyTransactionTicket()
Definition: DataUpdate.php:32
DataUpdate\runUpdates
static runUpdates(array $updates)
Convenience method, calls doUpdate() on every DataUpdate in the array.
Definition: DataUpdate.php:83
DataUpdate\__construct
__construct()
Stable to call.
Definition: DataUpdate.php:41
DataUpdate\setCause
setCause( $action, $user)
Definition: DataUpdate.php:57
DataUpdate\$causeAction
string $causeAction
Short update cause action description.
Definition: DataUpdate.php:34
DeferrableUpdate
Interface that deferrable updates should implement.
Definition: DeferrableUpdate.php:11
DataUpdate\getCauseAction
getCauseAction()
Definition: DataUpdate.php:65