WikibaseLexeme
MediaWiki WikibaseLexeme extension
Loading...
Searching...
No Matches
Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor Class Reference
+ Collaboration diagram for Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor:

Public Member Functions

 __construct (LexemeMerger $lexemeMerger, SummaryFormatter $summaryFormatter, MediaWikiLexemeRedirector $lexemeRedirector, EntityPermissionChecker $permissionChecker, PermissionManager $permissionManager, EntityTitleStoreLookup $entityTitleLookup, WatchedItemStoreInterface $watchedItemStore, EntityRevisionLookup $entityRevisionLookup, MediaWikiEditEntityFactory $editEntityFactory)
 
 mergeLexemes (LexemeId $sourceId, LexemeId $targetId, IContextSource $context, ?string $summary=null, bool $botEditRequested=false, array $tags=[])
 

Private Member Functions

 checkCanMerge (LexemeId $lexemeId, IContextSource $context)
 
 getLexeme (LexemeId $lexemeId)
 
 validateEntities (EntityDocument $fromEntity, EntityDocument $toEntity)
 
 getSummary (string $direction, Lexeme $lexeme, ?string $customSummary=null)
 
 attemptSaveMerge (Lexeme $source, Lexeme $target, IContextSource $context, ?string $summary, bool $botEditRequested, array $tags)
 
 saveLexeme (Lexeme $lexeme, IContextSource $context, FormatableSummary $summary, bool $botEditRequested, array $tags)
 
 updateWatchlistEntries (LexemeId $fromId, LexemeId $toId)
 

Private Attributes

SummaryFormatter $summaryFormatter
 
EntityRevisionLookup $entityRevisionLookup
 
MediaWikiLexemeRedirector $lexemeRedirector
 
EntityPermissionChecker $permissionChecker
 
PermissionManager $permissionManager
 
EntityTitleStoreLookup $entityTitleLookup
 
LexemeMerger $lexemeMerger
 
WatchedItemStoreInterface $watchedItemStore
 
MediaWikiEditEntityFactory $editEntityFactory
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::__construct ( LexemeMerger $lexemeMerger,
SummaryFormatter $summaryFormatter,
MediaWikiLexemeRedirector $lexemeRedirector,
EntityPermissionChecker $permissionChecker,
PermissionManager $permissionManager,
EntityTitleStoreLookup $entityTitleLookup,
WatchedItemStoreInterface $watchedItemStore,
EntityRevisionLookup $entityRevisionLookup,
MediaWikiEditEntityFactory $editEntityFactory )

Member Function Documentation

◆ attemptSaveMerge()

Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::attemptSaveMerge ( Lexeme $source,
Lexeme $target,
IContextSource $context,
?string $summary,
bool $botEditRequested,
array $tags )
private

◆ checkCanMerge()

Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::checkCanMerge ( LexemeId $lexemeId,
IContextSource $context )
private

◆ getLexeme()

Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::getLexeme ( LexemeId $lexemeId)
private
Exceptions
MergingException

◆ getSummary()

Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::getSummary ( string $direction,
Lexeme $lexeme,
?string $customSummary = null )
private
Parameters
string$directioneither 'from' or 'to'
Lexeme$lexeme
string | null$customSummary
Returns
Summary

◆ mergeLexemes()

Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::mergeLexemes ( LexemeId $sourceId,
LexemeId $targetId,
IContextSource $context,
?string $summary = null,
bool $botEditRequested = false,
array $tags = [] )
Parameters
LexemeId$sourceId
LexemeId$targetId
string | null$summary- only relevant when called through the API
string[]$tags
Returns
MergeLexemesStatus Note that the status is only returned to wrap the context and saved temp user in a strongly typed container. Errors are (currently) reported as exceptions, not as a failed status. (It would be nice to fix this at some point and use status consistently.)
Exceptions
MergingException

◆ saveLexeme()

Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::saveLexeme ( Lexeme $lexeme,
IContextSource $context,
FormatableSummary $summary,
bool $botEditRequested,
array $tags )
private

◆ updateWatchlistEntries()

Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::updateWatchlistEntries ( LexemeId $fromId,
LexemeId $toId )
private

◆ validateEntities()

Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::validateEntities ( EntityDocument $fromEntity,
EntityDocument $toEntity )
private
Exceptions
ReferenceSameLexemeException

Member Data Documentation

◆ $editEntityFactory

MediaWikiEditEntityFactory Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::$editEntityFactory
private

◆ $entityRevisionLookup

EntityRevisionLookup Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::$entityRevisionLookup
private

◆ $entityTitleLookup

EntityTitleStoreLookup Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::$entityTitleLookup
private

◆ $lexemeMerger

LexemeMerger Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::$lexemeMerger
private

◆ $lexemeRedirector

MediaWikiLexemeRedirector Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::$lexemeRedirector
private

◆ $permissionChecker

EntityPermissionChecker Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::$permissionChecker
private

◆ $permissionManager

PermissionManager Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::$permissionManager
private

◆ $summaryFormatter

SummaryFormatter Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::$summaryFormatter
private

◆ $watchedItemStore

WatchedItemStoreInterface Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::$watchedItemStore
private

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