Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Interactors\ItemMergeInteractor Class Reference

Public Member Functions

 __construct (MergeFactory $mergeFactory, EntityRevisionLookup $entityRevisionLookup, EntityStore $entityStore, EntityPermissionChecker $permissionChecker, SummaryFormatter $summaryFormatter, User $user, ItemRedirectCreationInteractor $interactorRedirect, EntityTitleStoreLookup $entityTitleLookup, PermissionManager $permissionManager)
 

Private Member Functions

 checkPermissions (EntityId $entityId)
 Check user's 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 ( $direction, ItemId $getId, $customSummary=null)
 
 attemptSaveMerge (Item $fromItem, Item $toItem, $summary, $bot)
 
 saveItem (Item $item, FormatableSummary $summary, $bot)
 
 updateWatchlistEntries (ItemId $fromId, ItemId $toId)
 

Private Attributes

 $mergeFactory
 
 $entityRevisionLookup
 
 $entityStore
 
 $permissionChecker
 
 $summaryFormatter
 
 $user
 
 $interactorRedirect
 
 $entityTitleLookup
 
 $permissionManager
 

Detailed Description

Author
Addshore
Daniel Kinzler
Lucie-Aimée Kaffee

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ attemptSaveMerge()

Wikibase\Repo\Interactors\ItemMergeInteractor::attemptSaveMerge ( Item  $fromItem,
Item  $toItem,
  $summary,
  $bot 
)
private
Parameters
Item$fromItem
Item$toItem
string | null$summary
bool$bot
Returns
array A list of exactly two EntityRevision objects. The first one represents the modified source item, the second one represents the modified target item.

◆ checkPermissions()

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

Check user's for the given entity ID.

Parameters
EntityId$entityId
Exceptions
ItemMergeExceptionif the permission check fails

◆ getSummary()

Wikibase\Repo\Interactors\ItemMergeInteractor::getSummary (   $direction,
ItemId  $getId,
  $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
Parameters
ItemId$itemId
Returns
bool

◆ 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,
  $bot 
)
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

◆ $entityRevisionLookup

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

◆ $entityStore

Wikibase\Repo\Interactors\ItemMergeInteractor::$entityStore
private

◆ $entityTitleLookup

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

◆ $interactorRedirect

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

◆ $mergeFactory

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

◆ $permissionChecker

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

◆ $permissionManager

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

◆ $summaryFormatter

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

◆ $user

Wikibase\Repo\Interactors\ItemMergeInteractor::$user
private

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