Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\Api\MergeItems Class Reference
+ Inheritance diagram for Wikibase\Repo\Api\MergeItems:
+ Collaboration diagram for Wikibase\Repo\Api\MergeItems:

Public Member Functions

 __construct (ApiMain $mainModule, string $moduleName, EntityIdParser $idParser, ItemMergeInteractor $interactor, ApiErrorReporter $errorReporter, callable $resultBuilderInstantiator)
 
 execute ()
 
 needsToken ()
 
 isWriteMode ()
 

Static Public Member Functions

static factory (ApiMain $mainModule, string $moduleName, EntityIdParser $entityIdParser)
 

Protected Member Functions

 getAllowedParams ()
 
 getExamplesMessages ()
 

Private Member Functions

 getItemIdParam (array $parameters, string $name)
 
 mergeItems (ItemId $fromId, ItemId $toId, array $ignoreConflicts, ?string $summary, bool $bot)
 
 handleException (Exception $ex, string $errorCode, array $extraData=[])
 
 addEntityToOutput (EntityRevision $entityRevision, string $name)
 

Private Attributes

 $idParser
 
 $errorReporter
 
 $interactor
 
 $resultBuilder
 

Detailed Description

Author
Addshore
Daniel Kinzler
Lucie-Aimée Kaffee

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Api\MergeItems::__construct ( ApiMain  $mainModule,
string  $moduleName,
EntityIdParser  $idParser,
ItemMergeInteractor  $interactor,
ApiErrorReporter  $errorReporter,
callable  $resultBuilderInstantiator 
)
See also
ApiBase::__construct
Parameters
ApiMain$mainModule
string$moduleName
EntityIdParser$idParser
ItemMergeInteractor$interactor
ApiErrorReporter$errorReporter
callable$resultBuilderInstantiator

Member Function Documentation

◆ addEntityToOutput()

Wikibase\Repo\Api\MergeItems::addEntityToOutput ( EntityRevision  $entityRevision,
string  $name 
)
private

◆ execute()

Wikibase\Repo\Api\MergeItems::execute ( )

◆ factory()

static Wikibase\Repo\Api\MergeItems::factory ( ApiMain  $mainModule,
string  $moduleName,
EntityIdParser  $entityIdParser 
)
static

◆ getAllowedParams()

Wikibase\Repo\Api\MergeItems::getAllowedParams ( )
protected

◆ getExamplesMessages()

Wikibase\Repo\Api\MergeItems::getExamplesMessages ( )
protected

◆ getItemIdParam()

Wikibase\Repo\Api\MergeItems::getItemIdParam ( array  $parameters,
string  $name 
)
private
Parameters
array$parameters
string$name
Returns
ItemId
Exceptions
ApiUsageExceptionif the given parameter is not a valid ItemId
LogicException

◆ handleException()

Wikibase\Repo\Api\MergeItems::handleException ( Exception  $ex,
string  $errorCode,
array  $extraData = [] 
)
private
Parameters
Exception$ex
string$errorCode
string[]$extraData
Exceptions
ApiUsageExceptionalways

◆ isWriteMode()

Wikibase\Repo\Api\MergeItems::isWriteMode ( )
See also
ApiBase::isWriteMode
Returns
bool Always true.

◆ mergeItems()

Wikibase\Repo\Api\MergeItems::mergeItems ( ItemId  $fromId,
ItemId  $toId,
array  $ignoreConflicts,
?string  $summary,
bool  $bot 
)
private
Parameters
ItemId$fromId
ItemId$toId
string[]$ignoreConflicts
string | null$summary
bool$bot
Exceptions
ItemMergeException
RedirectCreationException

◆ needsToken()

Wikibase\Repo\Api\MergeItems::needsToken ( )
See also
ApiBase::needsToken
Returns
string

Member Data Documentation

◆ $errorReporter

Wikibase\Repo\Api\MergeItems::$errorReporter
private

◆ $idParser

Wikibase\Repo\Api\MergeItems::$idParser
private

◆ $interactor

Wikibase\Repo\Api\MergeItems::$interactor
private

◆ $resultBuilder

Wikibase\Repo\Api\MergeItems::$resultBuilder
private

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