MediaWiki REL1_40
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.
 
 setIsNew (bool $isNew)
 Set whether the edit created a new page.
 
 setOriginalRevision ( $originalRevision)
 
 setRevisionRecord (RevisionRecord $revisionRecord)
 Set the revision associated with this edit.
 

Public Attributes

const CONSTRUCTOR_OPTIONS
 

Detailed Description

Builder class for the EditResult object.

Access: internal
Only for use by PageUpdater
Since
1.35
Author
Ostrzyciel

Definition at line 36 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 91 of file EditResultBuilder.php.

References MediaWiki\Config\ServiceOptions\assertRequiredOptions().

Member Function Documentation

◆ buildEditResult()

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

Definition at line 106 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 160 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 147 of file EditResultBuilder.php.

◆ setOriginalRevision()

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

Definition at line 198 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 137 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 38 of file EditResultBuilder.php.

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


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