abstract class DataUpdate implements DeferrableUpdate {
/** @var mixed Result from LBFactory::getEmptyTransactionTicket() */
protected $ticket;
+ /** @var string Short update cause action description */
+ protected $causeAction = 'unknown';
+ /** @var string Short update cause user description */
+ protected $causeAgent = 'unknown';
public function __construct() {
// noop
$this->ticket = $ticket;
}
+ /**
+ * @param string $action Action type
+ * @param string $user User name
+ */
+ public function setCause( $action, $user ) {
+ $this->causeAction = $action;
+ $this->causeAgent = $user;
+ }
+
+ /**
+ * @return string
+ */
+ public function getCauseAction() {
+ return $this->causeAction;
+ }
+
+ /**
+ * @return string
+ */
+ public function getCauseAgent() {
+ return $this->causeAgent;
+ }
+
/**
* Convenience method, calls doUpdate() on every DataUpdate in the array.
*
* @param DataUpdate[] $updates A list of DataUpdate instances
- * @param string $mode Use "enqueue" to use the job queue when possible [Default: run]
* @throws Exception
* @deprecated Since 1.28 Use DeferredUpdates::execute()
*/
- public static function runUpdates( array $updates, $mode = 'run' ) {
- DeferredUpdates::execute( $updates, $mode, DeferredUpdates::ALL );
+ public static function runUpdates( array $updates ) {
+ foreach ( $updates as $update ) {
+ $update->doUpdate();
+ }
}
}