Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Interactors\ItemMergeInteractor Class Reference
+ Collaboration diagram for Wikibase\Repo\Interactors\ItemMergeInteractor:

Public Member Functions

 __construct (MergeFactory $mergeFactory, EntityRevisionLookup $entityRevisionLookup, MediaWikiEditEntityFactory $editEntityFactory, EntityPermissionChecker $permissionChecker, SummaryFormatter $summaryFormatter, ItemRedirectCreationInteractor $interactorRedirect, EntityTitleStoreLookup $entityTitleLookup, PermissionManager $permissionManager)
 

Private Member Functions

 checkPermissions (EntityId $entityId, User $user)
 Check user's merge permissions for the given entity ID.
 
 isEmpty (ItemId $itemId)
 
 loadEntity (ItemId $itemId)
 Either throws an exception or returns a EntityDocument object.
 
 validateEntities (EntityDocument $fromEntity, EntityDocument $toEntity)
 
 getSummary (string $direction, ItemId $getId, ?string $customSummary=null)
 
 attemptSaveMerge (Item $fromItem, Item $toItem, ?string $summary, IContextSource $context, bool $bot, array $tags)
 
 saveItem (Item $item, FormatableSummary $summary, IContextSource $context, bool $bot, array $tags)
 
 updateWatchlistEntries (ItemId $fromId, ItemId $toId)
 

Private Attributes

MergeFactory $mergeFactory
 
EntityRevisionLookup $entityRevisionLookup
 
MediaWikiEditEntityFactory $editEntityFactory
 
EntityPermissionChecker $permissionChecker
 
SummaryFormatter $summaryFormatter
 
ItemRedirectCreationInteractor $interactorRedirect
 
EntityTitleStoreLookup $entityTitleLookup
 
PermissionManager $permissionManager
 

Detailed Description

Author
Addshore
Daniel Kinzler
Lucie-Aimée Kaffee

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Interactors\ItemMergeInteractor::__construct ( MergeFactory $mergeFactory,
EntityRevisionLookup $entityRevisionLookup,
MediaWikiEditEntityFactory $editEntityFactory,
EntityPermissionChecker $permissionChecker,
SummaryFormatter $summaryFormatter,
ItemRedirectCreationInteractor $interactorRedirect,
EntityTitleStoreLookup $entityTitleLookup,
PermissionManager $permissionManager )

Member Function Documentation

◆ attemptSaveMerge()

Wikibase\Repo\Interactors\ItemMergeInteractor::attemptSaveMerge ( Item $fromItem,
Item $toItem,
?string $summary,
IContextSource $context,
bool $bot,
array $tags )
private
Parameters
Item$fromItem
Item$toItem
string | null$summary
IContextSource$context
bool$bot
string[]$tags
Returns
ItemMergeStatus but with the 'redirected' member missing (to be added by the caller)

◆ checkPermissions()

Wikibase\Repo\Interactors\ItemMergeInteractor::checkPermissions ( EntityId $entityId,
User $user )
private

Check user's merge permissions for the given entity ID.

(Note that this is not redundant with the check in EditEntity later, because that checks edit permissions, not merge.)

Parameters
EntityId$entityId
Exceptions
ItemMergeExceptionif the permission check fails

◆ getSummary()

Wikibase\Repo\Interactors\ItemMergeInteractor::getSummary ( string $direction,
ItemId $getId,
?string $customSummary = null )
private
Parameters
string$directioneither 'from' or 'to'
ItemId$getId
string | null$customSummary
Returns
Summary

◆ isEmpty()

Wikibase\Repo\Interactors\ItemMergeInteractor::isEmpty ( ItemId $itemId)
private

◆ loadEntity()

Wikibase\Repo\Interactors\ItemMergeInteractor::loadEntity ( ItemId $itemId)
private

Either throws an exception or returns a EntityDocument object.

Parameters
ItemId$itemId
Returns
EntityDocument
Exceptions
ItemMergeException

◆ saveItem()

Wikibase\Repo\Interactors\ItemMergeInteractor::saveItem ( Item $item,
FormatableSummary $summary,
IContextSource $context,
bool $bot,
array $tags )
private

◆ updateWatchlistEntries()

Wikibase\Repo\Interactors\ItemMergeInteractor::updateWatchlistEntries ( ItemId $fromId,
ItemId $toId )
private

◆ validateEntities()

Wikibase\Repo\Interactors\ItemMergeInteractor::validateEntities ( EntityDocument $fromEntity,
EntityDocument $toEntity )
private
Parameters
EntityDocument$fromEntity
EntityDocument$toEntity
Exceptions
ItemMergeException

Member Data Documentation

◆ $editEntityFactory

MediaWikiEditEntityFactory Wikibase\Repo\Interactors\ItemMergeInteractor::$editEntityFactory
private

◆ $entityRevisionLookup

EntityRevisionLookup Wikibase\Repo\Interactors\ItemMergeInteractor::$entityRevisionLookup
private

◆ $entityTitleLookup

EntityTitleStoreLookup Wikibase\Repo\Interactors\ItemMergeInteractor::$entityTitleLookup
private

◆ $interactorRedirect

ItemRedirectCreationInteractor Wikibase\Repo\Interactors\ItemMergeInteractor::$interactorRedirect
private

◆ $mergeFactory

MergeFactory Wikibase\Repo\Interactors\ItemMergeInteractor::$mergeFactory
private

◆ $permissionChecker

EntityPermissionChecker Wikibase\Repo\Interactors\ItemMergeInteractor::$permissionChecker
private

◆ $permissionManager

PermissionManager Wikibase\Repo\Interactors\ItemMergeInteractor::$permissionManager
private

◆ $summaryFormatter

SummaryFormatter Wikibase\Repo\Interactors\ItemMergeInteractor::$summaryFormatter
private

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