MediaWiki REL1_39
MediaWiki\Storage\EditResultCache Class Reference

Class allowing easy storage and retrieval of EditResults associated with revisions. More...

Public Member Functions

 __construct (BagOStuff $mainObjectStash, ILoadBalancer $loadBalancer, ServiceOptions $options)
 
 get (int $revisionId)
 Get an EditResult for the given revision ID.
 
 set (int $revisionId, EditResult $editResult)
 Store the EditResult in the main object stash.
 

Public Attributes

const CONSTRUCTOR_OPTIONS
 

Detailed Description

Class allowing easy storage and retrieval of EditResults associated with revisions.

EditResults are stored in the main object stash and (depending on wiki's configuration) in revert change tags. This class stores the relevant data in the main stash. When asked to retrieve an EditResult for an edit and the requested key is not present in the main stash, the class will attempt to retrieve the EditResult from revert tags.

Since
1.36
Access: internal
Used by RevertedTagUpdateManager

Definition at line 43 of file EditResultCache.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Storage\EditResultCache::__construct ( BagOStuff $mainObjectStash,
ILoadBalancer $loadBalancer,
ServiceOptions $options )
Parameters
BagOStuff$mainObjectStashMain object stash, see MediaWikiServices::getMainObjectStash()
ILoadBalancer$loadBalancer
ServiceOptions$options

Definition at line 66 of file EditResultCache.php.

References MediaWiki\Config\ServiceOptions\assertRequiredOptions().

Member Function Documentation

◆ get()

MediaWiki\Storage\EditResultCache::get ( int $revisionId)

Get an EditResult for the given revision ID.

Will first attempt to get the EditResult from the main stash. If this fails, it will try to retrieve the EditResult from revert change tags of this revision.

Parameters
int$revisionId
Returns
EditResult|null Returns null on failure

Definition at line 105 of file EditResultCache.php.

References $dbr, and DB_REPLICA.

◆ set()

MediaWiki\Storage\EditResultCache::set ( int $revisionId,
EditResult $editResult )

Store the EditResult in the main object stash.

Parameters
int$revisionId
EditResult$editResult
Returns
bool Success

Definition at line 86 of file EditResultCache.php.

Member Data Documentation

◆ CONSTRUCTOR_OPTIONS

const MediaWiki\Storage\EditResultCache::CONSTRUCTOR_OPTIONS
Initial value:
= [
]
const RCMaxAge
Name constant for the RCMaxAge setting, for use with Config::get()

Definition at line 45 of file EditResultCache.php.


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