WikibaseLexeme
MediaWiki WikibaseLexeme extension
Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor Class Reference

Public Member Functions

 __construct (LexemeMerger $lexemeMerger, LexemeAuthorizer $authorizer, SummaryFormatter $summaryFormatter, MediaWikiLexemeRedirectorFactory $lexemeRedirectorFactory, EntityTitleStoreLookup $entityTitleLookup, WatchedItemStoreInterface $watchedItemStore, MediaWikiLexemeRepositoryFactory $repoFactory)
 
 mergeLexemes (LexemeId $sourceId, LexemeId $targetId, IContextSource $context, ?string $summary=null, bool $botEditRequested=false, array $tags=[])
 

Private Member Functions

 getLexeme (LexemeRepository $repo, LexemeId $lexemeId)
 
 validateEntities (EntityDocument $fromEntity, EntityDocument $toEntity)
 
 getSummary ( $direction, LexemeId $id, $customSummary=null)
 
 attemptSaveMerge (LexemeRepository $repo, Lexeme $source, Lexeme $target, ?string $summary)
 
 saveLexeme (LexemeRepository $repo, Lexeme $lexeme, FormatableSummary $summary)
 
 updateWatchlistEntries (LexemeId $fromId, LexemeId $toId)
 

Private Attributes

 $authorizer
 
 $summaryFormatter
 
 $repoFactory
 
 $lexemeRedirectorFactory
 
 $entityTitleLookup
 
 $lexemeMerger
 
 $watchedItemStore
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::__construct ( LexemeMerger  $lexemeMerger,
LexemeAuthorizer  $authorizer,
SummaryFormatter  $summaryFormatter,
MediaWikiLexemeRedirectorFactory  $lexemeRedirectorFactory,
EntityTitleStoreLookup  $entityTitleLookup,
WatchedItemStoreInterface  $watchedItemStore,
MediaWikiLexemeRepositoryFactory  $repoFactory 
)

Member Function Documentation

◆ attemptSaveMerge()

Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::attemptSaveMerge ( LexemeRepository  $repo,
Lexeme  $source,
Lexeme  $target,
?string  $summary 
)
private

◆ getLexeme()

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

◆ getSummary()

Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::getSummary (   $direction,
LexemeId  $id,
  $customSummary = null 
)
private
Parameters
string$directioneither 'from' or 'to'
LexemeId$id
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
Exceptions
MergingException

◆ saveLexeme()

Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::saveLexeme ( LexemeRepository  $repo,
Lexeme  $lexeme,
FormatableSummary  $summary 
)
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
Parameters
EntityDocument$fromEntity
EntityDocument$toEntity
Exceptions
ReferenceSameLexemeException

Member Data Documentation

◆ $authorizer

Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::$authorizer
private

◆ $entityTitleLookup

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

◆ $lexemeMerger

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

◆ $lexemeRedirectorFactory

Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::$lexemeRedirectorFactory
private

◆ $repoFactory

Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor::$repoFactory
private

◆ $summaryFormatter

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

◆ $watchedItemStore

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

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