MediaWiki  REL1_22
DataUpdate Class Reference

Abstract base class for update jobs that do something with some secondary data extracted from article. More...

Inheritance diagram for DataUpdate:
Collaboration diagram for DataUpdate:

List of all members.

Public Member Functions

 __construct ()
 Constructor.
 beginTransaction ()
 Begin an appropriate transaction, if any.
 commitTransaction ()
 Commit the transaction started via beginTransaction, if any.
 rollbackTransaction ()
 Abort / roll back the transaction started via beginTransaction, if any.

Static Public Member Functions

static runUpdates ($updates)
 Convenience method, calls doUpdate() on every DataUpdate in the array.

Detailed Description

Abstract base class for update jobs that do something with some secondary data extracted from article.

Note:
: subclasses should NOT start or commit transactions in their doUpdate() method, a transaction will automatically be wrapped around the update. If need be, subclasses can override the beginTransaction() and commitTransaction() methods.

Definition at line 32 of file DataUpdate.php.


Constructor & Destructor Documentation

Constructor.

Definition at line 37 of file DataUpdate.php.

Referenced by SqlDataUpdate\__construct().


Member Function Documentation

Begin an appropriate transaction, if any.

This default implementation does nothing.

Reimplemented in SqlDataUpdate.

Definition at line 45 of file DataUpdate.php.

Commit the transaction started via beginTransaction, if any.

This default implementation does nothing.

Reimplemented in SqlDataUpdate.

Definition at line 53 of file DataUpdate.php.

Abort / roll back the transaction started via beginTransaction, if any.

This default implementation does nothing.

Definition at line 61 of file DataUpdate.php.

static DataUpdate::runUpdates ( updates) [static]

Convenience method, calls doUpdate() on every DataUpdate in the array.

This methods supports transactions logic by first calling beginTransaction() on all updates in the array, then calling doUpdate() on each, and, if all goes well, then calling commitTransaction() on each update. If an error occurs, rollbackTransaction() will be called on any update object that had beginTransaction() called but not yet commitTransaction().

This allows for limited transactional logic across multiple backends for storing secondary data.

Parameters:
array$updatesa list of DataUpdate instances
Exceptions:
Exception|null

Definition at line 80 of file DataUpdate.php.

References array(), as, empty, and wfDebug().

Referenced by WikiPage\doDeleteUpdates(), ApiPurge\execute(), RefreshLinks\fixLinksFromArticle(), and RefreshLinksJob\runForTitleInternal().


The documentation for this class was generated from the following file: