MediaWiki REL1_39
MediaWiki\Storage\RevertedTagUpdate Class Reference

Adds the mw-reverted tag to reverted edits after a revert is made. More...

Inheritance diagram for MediaWiki\Storage\RevertedTagUpdate:
Collaboration diagram for MediaWiki\Storage\RevertedTagUpdate:

Public Member Functions

 __construct (RevisionStore $revisionStore, LoggerInterface $logger, array $softwareTags, ILoadBalancer $loadBalancer, ServiceOptions $serviceOptions, int $revertId, EditResult $editResult)
 
 doUpdate ()
 Marks reverted edits with mw-reverted tag.
 

Public Attributes

const CONSTRUCTOR_OPTIONS = [ MainConfigNames::RevertedTagMaxDepth ]
 

Protected Member Functions

 getChangeTags (int $revisionId)
 Protected function calling static ChangeTags class to allow for unit testing of this deferrable update.
 
 markAsReverted (int $revisionId, array $extraParams)
 Protected function calling static ChangeTags class to allow for unit testing of this deferrable update.
 

Detailed Description

Adds the mw-reverted tag to reverted edits after a revert is made.

This class is used by RevertedTagUpdateJob to perform the actual update.

Since
1.36

Definition at line 42 of file RevertedTagUpdate.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Storage\RevertedTagUpdate::__construct ( RevisionStore $revisionStore,
LoggerInterface $logger,
array $softwareTags,
ILoadBalancer $loadBalancer,
ServiceOptions $serviceOptions,
int $revertId,
EditResult $editResult )
Parameters
RevisionStore$revisionStore
LoggerInterface$logger
string[]$softwareTagsArray of currently enabled software change tags. Can be obtained from ChangeTags::getSoftwareTags()
ILoadBalancer$loadBalancer
ServiceOptions$serviceOptions
int$revertIdID of the revert
EditResult$editResultEditResult object of this revert

Definition at line 89 of file RevertedTagUpdate.php.

References MediaWiki\Config\ServiceOptions\assertRequiredOptions().

Member Function Documentation

◆ doUpdate()

MediaWiki\Storage\RevertedTagUpdate::doUpdate ( )

Marks reverted edits with mw-reverted tag.

Implements DeferrableUpdate.

Definition at line 112 of file RevertedTagUpdate.php.

References MediaWiki\Storage\RevertedTagUpdate\markAsReverted(), and MediaWiki\MainConfigNames\RevertedTagMaxDepth.

◆ getChangeTags()

MediaWiki\Storage\RevertedTagUpdate::getChangeTags ( int $revisionId)
protected

Protected function calling static ChangeTags class to allow for unit testing of this deferrable update.

This class is not stable for extending, this is just to make the class testable.

ChangeTags should be passed by dependency injection when that becomes possible. See: T245964

Parameters
int$revisionId
Returns
string[]

Definition at line 324 of file RevertedTagUpdate.php.

References DB_REPLICA, and ChangeTags\getTags().

◆ markAsReverted()

MediaWiki\Storage\RevertedTagUpdate::markAsReverted ( int $revisionId,
array $extraParams )
protected

Protected function calling static ChangeTags class to allow for unit testing of this deferrable update.

This class is not stable for extending, this is just to make the class testable.

ChangeTags should be passed by dependency injection when that becomes possible. See: T245964

Parameters
int$revisionIdID of the revision to mark as reverted
array$extraParamsParams to put in the ct_params field of table 'change_tag'

Definition at line 301 of file RevertedTagUpdate.php.

References ChangeTags\addTags(), and ChangeTags\TAG_REVERTED.

Referenced by MediaWiki\Storage\RevertedTagUpdate\doUpdate().

Member Data Documentation

◆ CONSTRUCTOR_OPTIONS

const MediaWiki\Storage\RevertedTagUpdate::CONSTRUCTOR_OPTIONS = [ MainConfigNames::RevertedTagMaxDepth ]
Access: internal

Definition at line 47 of file RevertedTagUpdate.php.


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