MediaWiki  1.33.1
RevDelList Class Reference

Abstract base class for a list of deletable items. More...

Inheritance diagram for RevDelList:
Collaboration diagram for RevDelList:

Public Member Functions

 __construct (IContextSource $context, Title $title, array $ids)
 
 areAnySuppressed ()
 Indicate whether any item in this list is suppressed. More...
 
 clearFileOps ()
 Clear any data structures needed for doPreCommitUpdates() and doPostCommitUpdates() STUB. More...
 
 doPostCommitUpdates (array $visibilityChangeMap)
 A hook for setVisibility(): do any necessary updates post-commit. More...
 
 doPreCommitUpdates ()
 A hook for setVisibility(): do batch updates pre-commit. More...
 
 getLogAction ()
 Get the log action for this list type. More...
 
 getLogParams ( $params)
 Get log parameter array. More...
 
 getSuppressBit ()
 Get the integer value of the flag used for suppression. More...
 
 reloadFromMaster ()
 Reload the list data from the master DB. More...
 
 setVisibility (array $params)
 Set the visibility for the revisions in this list. More...
 
- Public Member Functions inherited from RevisionListBase
 __construct (IContextSource $context, Title $title)
 Construct a revision list for a given title. More...
 
 current ()
 Get the current list item, or false if we are at the end. More...
 
 doQuery ( $db)
 Do the DB query to iterate through the objects. More...
 
 filterByIds (array $ids)
 Select items only where the ID is any of the specified values. More...
 
 getType ()
 Get the internal type name of this list. More...
 
 key ()
 
 length ()
 Get the number of items in the list. More...
 
 newItem ( $row)
 Create an item object from a DB result row. More...
 
 next ()
 Move the iteration pointer to the next list item, and return it. More...
 
 reset ()
 Start iteration. More...
 
 rewind ()
 
 valid ()
 
- Public Member Functions inherited from ContextSource
 canUseWikiPage ()
 Check whether a WikiPage object can be get with getWikiPage(). More...
 
 exportSession ()
 Export the resolved user IP, HTTP headers, user ID, and session ID. More...
 
 getConfig ()
 
 getContext ()
 Get the base IContextSource object. More...
 
 getLanguage ()
 
 getOutput ()
 
 getRequest ()
 
 getSkin ()
 
 getStats ()
 
 getTiming ()
 
 getTitle ()
 
 getUser ()
 
 getWikiPage ()
 Get the WikiPage object. More...
 
 msg ( $key)
 Get a Message object with context set Parameters are the same as wfMessage() More...
 
 setContext (IContextSource $context)
 

Static Public Member Functions

static getRelationType ()
 Get the DB field name associated with the ID list. More...
 
static getRestriction ()
 Get the user right required for this list type Override this function. More...
 
static getRevdelConstant ()
 Get the revision deletion constant for this list type Override this function. More...
 
static suggestTarget ( $target, array $ids)
 Suggest a target for the revision deletion Optionally override this function. More...
 

Protected Member Functions

 acquireItemLocks ()
 
 releaseItemLocks ()
 
- Protected Member Functions inherited from RevisionListBase
 initCurrent ()
 Initialise the current iteration pointer. More...
 

Private Member Functions

 updateLog ( $logType, $params)
 Record a log entry on the action. More...
 

Additional Inherited Members

- Public Attributes inherited from RevisionListBase
Title $title
 
- Protected Attributes inherited from RevisionListBase
bool Revision $current
 
array $ids
 
ResultWrapper bool $res
 

Detailed Description

Abstract base class for a list of deletable items.

The list class needs to be able to make a query from a set of identifiers to pull relevant rows, to return RevDelItem subclasses wrapping them, and to wrap bulk update operations.

Definition at line 30 of file RevDelList.php.

Constructor & Destructor Documentation

◆ __construct()

RevDelList::__construct ( IContextSource  $context,
Title  $title,
array  $ids 
)

Member Function Documentation

◆ acquireItemLocks()

RevDelList::acquireItemLocks ( )
finalprotected

Definition at line 321 of file RevDelList.php.

References as, and StatusValue\newGood().

Referenced by setVisibility().

◆ areAnySuppressed()

RevDelList::areAnySuppressed ( )

Indicate whether any item in this list is suppressed.

Since
1.25
Returns
bool

Definition at line 83 of file RevDelList.php.

References as, and getSuppressBit().

◆ clearFileOps()

RevDelList::clearFileOps ( )

Clear any data structures needed for doPreCommitUpdates() and doPostCommitUpdates() STUB.

Reimplemented in RevDelFileList.

Definition at line 427 of file RevDelList.php.

Referenced by setVisibility().

◆ doPostCommitUpdates()

RevDelList::doPostCommitUpdates ( array  $visibilityChangeMap)

A hook for setVisibility(): do any necessary updates post-commit.

STUB

Parameters
array$visibilityChangeMap[id => ['oldBits' => $oldBits, 'newBits' => $newBits], ... ]
Returns
Status

Reimplemented in RevDelRevisionList, RevDelFileList, and RevDelArchiveList.

Definition at line 445 of file RevDelList.php.

References StatusValue\newGood().

Referenced by setVisibility().

◆ doPreCommitUpdates()

RevDelList::doPreCommitUpdates ( )

A hook for setVisibility(): do batch updates pre-commit.

STUB

Returns
Status

Reimplemented in RevDelRevisionList, RevDelFileList, and RevDelArchiveList.

Definition at line 435 of file RevDelList.php.

References StatusValue\newGood().

Referenced by setVisibility().

◆ getLogAction()

RevDelList::getLogAction ( )

Get the log action for this list type.

Returns
string

Reimplemented in RevDelLogList.

Definition at line 405 of file RevDelList.php.

Referenced by updateLog().

◆ getLogParams()

RevDelList::getLogParams (   $params)

Get log parameter array.

Parameters
array$paramsAssociative array of log parameters, same as updateLog()
Returns
array

Reimplemented in RevDelLogList.

Definition at line 414 of file RevDelList.php.

References $params, and RevisionListBase\getType().

Referenced by updateLog().

◆ getRelationType()

static RevDelList::getRelationType ( )
static

Get the DB field name associated with the ID list.

This used to populate the log_search table for finding log entries. Override this function.

Returns
string|null

Reimplemented in RevDelRevisionList, RevDelFileList, RevDelArchivedFileList, RevDelArchiveList, and RevDelLogList.

Definition at line 42 of file RevDelList.php.

◆ getRestriction()

static RevDelList::getRestriction ( )
static

Get the user right required for this list type Override this function.

Since
1.22
Returns
string|null

Reimplemented in RevDelRevisionList, RevDelFileList, and RevDelLogList.

Definition at line 52 of file RevDelList.php.

◆ getRevdelConstant()

static RevDelList::getRevdelConstant ( )
static

Get the revision deletion constant for this list type Override this function.

Since
1.22
Returns
int|null

Reimplemented in RevDelRevisionList, RevDelFileList, and RevDelLogList.

Definition at line 62 of file RevDelList.php.

◆ getSuppressBit()

RevDelList::getSuppressBit ( )
abstract

Get the integer value of the flag used for suppression.

Reimplemented in RevDelRevisionList, RevDelFileList, and RevDelLogList.

Referenced by areAnySuppressed(), and setVisibility().

◆ releaseItemLocks()

RevDelList::releaseItemLocks ( )
finalprotected

Definition at line 331 of file RevDelList.php.

References as, and StatusValue\newGood().

Referenced by setVisibility().

◆ reloadFromMaster()

RevDelList::reloadFromMaster ( )

Reload the list data from the master DB.

This can be done after setVisibility() to allow $item->getHTML() to show the new data.

Definition at line 345 of file RevDelList.php.

References DB_MASTER, RevisionListBase\doQuery(), and wfGetDB().

◆ setVisibility()

RevDelList::setVisibility ( array  $params)

Set the visibility for the revisions in this list.

Logging and transactions are done here.

Parameters
array$paramsAssociative array of parameters. Members are: value: ExtractBitParams() bitfield array comment: The log comment perItemStatus: Set if you want per-item status reports tags: The array of change tags to apply to the log entry
Returns
Status
Since
1.23 Added 'perItemStatus' param

Definition at line 108 of file RevDelList.php.

References $params, $user, $wgActorTableSchemaMigrationStage, acquireItemLocks(), DeferredUpdates\addCallableUpdate(), as, clearFileOps(), DB_MASTER, Revision\DELETED_RESTRICTED, doPostCommitUpdates(), doPreCommitUpdates(), RevisionListBase\doQuery(), RevisionDeleter\extractBitfield(), false, getSuppressBit(), IP\isIPAddress(), StatusValue\newFatal(), User\newFromId(), User\newFromName(), StatusValue\newGood(), DeferredUpdates\PRESEND, releaseItemLocks(), SCHEMA_COMPAT_WRITE_NEW, SCHEMA_COMPAT_WRITE_OLD, title, updateLog(), use, and wfGetDB().

Referenced by ArticleViewTest\testUnhiddenViewOfDeletedRevision(), and ArticleViewTest\testViewOfDeletedRevision().

◆ suggestTarget()

static RevDelList::suggestTarget (   $target,
array  $ids 
)
static

Suggest a target for the revision deletion Optionally override this function.

Since
1.22
Parameters
Title | null$targetUser-supplied target
array$ids
Returns
Title|null

Reimplemented in RevDelRevisionList, and RevDelLogList.

Definition at line 74 of file RevDelList.php.

◆ updateLog()

RevDelList::updateLog (   $logType,
  $params 
)
private

Record a log entry on the action.

Parameters
string$logTypeOne of (delete,suppress)
array$paramsAssociative array of parameters: newBits: The new value of the *_deleted bitfield oldBits: The old value of the *_deleted bitfield. title: The target title ids: The ID list comment: The log comment authorIds: The array of the user IDs of the offenders authorIPs: The array of the IP/anon user offenders authorActors: The array of the actor IDs of the offenders tags: The array of change tags to apply to the log entry
Exceptions
MWException

Definition at line 365 of file RevDelList.php.

References $params, getLogAction(), getLogParams(), RevisionDeleter\getRelationType(), RevisionListBase\getType(), and ContextSource\getUser().

Referenced by setVisibility().


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