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, ItemMergeInteractor $interactor, ApiErrorReporter $errorReporter, callable $resultBuilderInstantiator, array $sandboxEntityIds)
 
 execute ()
 
 needsToken ()
 
 isWriteMode ()
 

Static Public Member Functions

static factory (ApiMain $mainModule, string $moduleName, ApiHelperFactory $apiHelperFactory, ItemMergeInteractor $interactor, SettingsArray $settings)
 

Protected Member Functions

 getAllowedParams ()
 
 getExamplesMessages ()
 

Private Member Functions

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

Private Attributes

 $errorReporter
 
 $interactor
 
 $resultBuilder
 
 $sandboxEntityIds
 

Detailed Description

Author
Addshore
Daniel Kinzler
Lucie-Aimée Kaffee

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Api\MergeItems::__construct ( ApiMain  $mainModule,
string  $moduleName,
ItemMergeInteractor  $interactor,
ApiErrorReporter  $errorReporter,
callable  $resultBuilderInstantiator,
array  $sandboxEntityIds 
)
See also
ApiBase::__construct
Parameters
ApiMain$mainModule
string$moduleName
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,
ApiHelperFactory  $apiHelperFactory,
ItemMergeInteractor  $interactor,
SettingsArray  $settings 
)
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,
array  $tags 
)
private
Parameters
ItemId$fromId
ItemId$toId
string[]$ignoreConflicts
string | null$summary
bool$bot
string[]$tagsAlready permission checked via self::PARAM_TYPE => 'tags'
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

◆ $interactor

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

◆ $resultBuilder

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

◆ $sandboxEntityIds

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

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