Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\Api\SetClaim Class Reference

API module for creating or updating an entire Claim. More...

+ Inheritance diagram for Wikibase\Repo\Api\SetClaim:
+ Collaboration diagram for Wikibase\Repo\Api\SetClaim:

Public Member Functions

 __construct (ApiMain $mainModule, string $moduleName, ApiErrorReporter $errorReporter, Deserializer $statementDeserializer, StatementChangeOpFactory $statementChangeOpFactory, StatementModificationHelper $modificationHelper, StatementGuidParser $guidParser, callable $resultBuilderInstantiator, callable $entitySavingHelperInstantiator, IBufferingStatsdDataFactory $stats, bool $federatedPropertiesEnabled)
 
 execute ()
 
 isWriteMode ()
 
 needsToken ()
 

Static Public Member Functions

static factory (ApiMain $mainModule, string $moduleName, IBufferingStatsdDataFactory $stats, EntityIdParser $entityIdParser, Deserializer $externalFormatStatementDeserializer, StatementGuidParser $statementGuidParser, StatementGuidValidator $statementGuidValidator)
 

Protected Member Functions

 getAllowedParams ()
 
 getExamplesMessages ()
 

Protected Attributes

 $errorReporter
 

Private Member Functions

 executeInternal ()
 
 statementMainSnakAlreadyExists (Statement $statement, StatementList $existingStatements)
 
 getSummary (array $params, Statement $statement, StatementList $statementList)
 
 getStatementFromParams (array $params)
 

Private Attributes

 $statementChangeOpFactory
 
 $statementDeserializer
 
 $modificationHelper
 
 $guidParser
 
 $resultBuilder
 
 $entitySavingHelper
 
 $stats
 

Detailed Description

API module for creating or updating an entire Claim.

Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >
Tobias Gritschacher < tobia.nosp@m.s.gr.nosp@m.itsch.nosp@m.ache.nosp@m.r@wik.nosp@m.imed.nosp@m.ia.de >
Addshore

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Api\SetClaim::__construct ( ApiMain  $mainModule,
string  $moduleName,
ApiErrorReporter  $errorReporter,
Deserializer  $statementDeserializer,
StatementChangeOpFactory  $statementChangeOpFactory,
StatementModificationHelper  $modificationHelper,
StatementGuidParser  $guidParser,
callable  $resultBuilderInstantiator,
callable  $entitySavingHelperInstantiator,
IBufferingStatsdDataFactory  $stats,
bool  $federatedPropertiesEnabled 
)

Member Function Documentation

◆ execute()

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

◆ executeInternal()

Wikibase\Repo\Api\SetClaim::executeInternal ( )
private

◆ factory()

static Wikibase\Repo\Api\SetClaim::factory ( ApiMain  $mainModule,
string  $moduleName,
IBufferingStatsdDataFactory  $stats,
EntityIdParser  $entityIdParser,
Deserializer  $externalFormatStatementDeserializer,
StatementGuidParser  $statementGuidParser,
StatementGuidValidator  $statementGuidValidator 
)
static

◆ getAllowedParams()

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

◆ getExamplesMessages()

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

◆ getStatementFromParams()

Wikibase\Repo\Api\SetClaim::getStatementFromParams ( array  $params)
private
Parameters
array$params
Exceptions
IllegalValueException
ApiUsageException
LogicException
Returns
Statement

◆ getSummary()

Wikibase\Repo\Api\SetClaim::getSummary ( array  $params,
Statement  $statement,
StatementList  $statementList 
)
private
Parameters
array$params
Statement$statement
StatementList$statementList
Exceptions
InvalidArgumentException
Returns
Summary
Todo:
this summary builder is ugly and summary stuff needs to be refactored

◆ isWriteMode()

Wikibase\Repo\Api\SetClaim::isWriteMode ( )

◆ needsToken()

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

◆ statementMainSnakAlreadyExists()

Wikibase\Repo\Api\SetClaim::statementMainSnakAlreadyExists ( Statement  $statement,
StatementList  $existingStatements 
)
private

Member Data Documentation

◆ $entitySavingHelper

Wikibase\Repo\Api\SetClaim::$entitySavingHelper
private

◆ $errorReporter

Wikibase\Repo\Api\SetClaim::$errorReporter
protected

◆ $guidParser

Wikibase\Repo\Api\SetClaim::$guidParser
private

◆ $modificationHelper

Wikibase\Repo\Api\SetClaim::$modificationHelper
private

◆ $resultBuilder

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

◆ $statementChangeOpFactory

Wikibase\Repo\Api\SetClaim::$statementChangeOpFactory
private

◆ $statementDeserializer

Wikibase\Repo\Api\SetClaim::$statementDeserializer
private

◆ $stats

Wikibase\Repo\Api\SetClaim::$stats
private

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