MediaWiki  master
MediaWiki\Storage\EditResultBuilder Class Reference

Builder class for the EditResult object. More...

Public Member Functions

 __construct (RevisionStore $revisionStore, array $softwareTags, ServiceOptions $options)
 
 buildEditResult ()
 
 markAsRevert (int $revertMethod, int $newestRevertedRevId, int $revertAfterRevId=null)
 Marks this edit as a revert and applies relevant information. More...
 
 setIsNew (bool $isNew)
 Set whether the edit created a new page. More...
 
 setOriginalRevision ( $originalRevision)
 
 setRevisionRecord (RevisionRecord $revisionRecord)
 Set the revision associated with this edit. More...
 

Public Attributes

const CONSTRUCTOR_OPTIONS
 

Detailed Description

Builder class for the EditResult object.

Access: internal
Only for use by PageUpdater
Since
1.35

Definition at line 39 of file EditResultBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Storage\EditResultBuilder::__construct ( RevisionStore  $revisionStore,
array  $softwareTags,
ServiceOptions  $options 
)
Parameters
RevisionStore$revisionStore
string[]$softwareTagsArray of currently enabled software change tags. Can be obtained from ChangeTags::getSoftwareTags()
ServiceOptions$optionsOptions for this instance.

Definition at line 94 of file EditResultBuilder.php.

References MediaWiki\Config\ServiceOptions\assertRequiredOptions().

Member Function Documentation

◆ buildEditResult()

MediaWiki\Storage\EditResultBuilder::buildEditResult ( )
Returns
EditResult

Definition at line 109 of file EditResultBuilder.php.

◆ markAsRevert()

MediaWiki\Storage\EditResultBuilder::markAsRevert ( int  $revertMethod,
int  $newestRevertedRevId,
int  $revertAfterRevId = null 
)

Marks this edit as a revert and applies relevant information.

Parameters
int$revertMethodThe method used to make the revert: REVERT_UNDO, REVERT_ROLLBACK or REVERT_MANUAL
int$newestRevertedRevIdthe revision ID of the latest reverted revision.
int | null$revertAfterRevIdthe revision ID after which revisions are being reverted. Defaults to the revision before the $newestRevertedRevId.

Definition at line 163 of file EditResultBuilder.php.

References MediaWiki\Storage\EditResult\REVERT_MANUAL, MediaWiki\Storage\EditResult\REVERT_ROLLBACK, and MediaWiki\Storage\EditResult\REVERT_UNDO.

◆ setIsNew()

MediaWiki\Storage\EditResultBuilder::setIsNew ( bool  $isNew)

Set whether the edit created a new page.

Should only be called by PageUpdater when saving an edit.

Parameters
bool$isNew

Definition at line 150 of file EditResultBuilder.php.

◆ setOriginalRevision()

MediaWiki\Storage\EditResultBuilder::setOriginalRevision (   $originalRevision)
Parameters
RevisionRecord | int | bool | null$originalRevisionRevisionRecord or revision ID for the original revision. False or null to unset.

Definition at line 201 of file EditResultBuilder.php.

◆ setRevisionRecord()

MediaWiki\Storage\EditResultBuilder::setRevisionRecord ( RevisionRecord  $revisionRecord)

Set the revision associated with this edit.

Should only be called by PageUpdater when saving an edit.

Parameters
RevisionRecord$revisionRecord

Definition at line 140 of file EditResultBuilder.php.

Member Data Documentation

◆ CONSTRUCTOR_OPTIONS

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

Definition at line 41 of file EditResultBuilder.php.

Referenced by MediaWiki\Storage\PageUpdater\__construct().


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