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  wfDeprecated( __METHOD__, '1.28' );
85  foreach ( $updates as $update ) {
86  $update->doUpdate();
87  }
88  }
89 }
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
Abstract base class for update jobs that do something with some secondary data extracted from article...
Definition: DataUpdate.php:30
string $causeAction
Short update cause action description.
Definition: DataUpdate.php:34
mixed $ticket
Result from LBFactory::getEmptyTransactionTicket()
Definition: DataUpdate.php:32
static runUpdates(array $updates)
Convenience method, calls doUpdate() on every DataUpdate in the array.
Definition: DataUpdate.php:83
getCauseAction()
Definition: DataUpdate.php:65
setCause( $action, $user)
Definition: DataUpdate.php:57
setTransactionTicket( $ticket)
Definition: DataUpdate.php:49
string $causeAgent
Short update cause user description.
Definition: DataUpdate.php:36
Interface that deferrable updates should implement.