Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Api\SetLabel Class Reference

API module to set the label for a Wikibase entity. More...

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

Public Member Functions

 __construct (ApiMain $mainModule, string $moduleName, FingerprintChangeOpFactory $termChangeOpFactory, bool $federatedPropertiesEnabled, EntityFactory $entityFactory, array $sandboxEntityIds)
 
 needsToken ()
 
 isWriteMode ()
 
- Public Member Functions inherited from Wikibase\Repo\Api\ModifyEntity
 __construct (ApiMain $mainModule, string $moduleName, bool $federatedPropertiesEnabled, string $modulePrefix='')
 
 setServices (SiteLinkGlobalIdentifiersProvider $siteLinkGlobalIdentifiersProvider)
 
 execute ()
 
 isFreshIdAssigned ()
 Return whether a fresh id is assigned or not.
 

Static Public Member Functions

static factory (ApiMain $mainModule, string $moduleName, ChangeOpFactoryProvider $changeOpFactoryProvider, EntityFactory $entityFactory, SettingsArray $repoSettings)
 

Protected Member Functions

 modifyEntity (EntityDocument $entity, ChangeOp $changeOp, array $preparedParameters)
 Actually modify the entity.
 
 getChangeOp (array $preparedParameters, EntityDocument $entity)
 
 getExamplesMessages ()
 
 getAllowedParams ()
 
 getEntityTypesWithLabels ()
 
- Protected Member Functions inherited from Wikibase\Repo\Api\ModifyTerm
 createSummary (array $params)
 Creates a Summary object based on the given API call parameters.
 
- Protected Member Functions inherited from Wikibase\Repo\Api\ModifyEntity
 getTitleLookup ()
 
 getResultBuilder ()
 
 applyChangeOp (ChangeOp $changeOp, EntityDocument $entity, Summary $summary=null)
 Applies the given ChangeOp to the given Entity.
 
 prepareParameters (array $params)
 
 validateEntitySpecificParameters (array $preparedParameters, EntityDocument $entity, int $baseRevId)
 
 validateParameters (array $params)
 Make sure the required parameters are provided and that they are valid.
 

Private Attributes

 $termChangeOpFactory
 
 $entityFactory
 
 $sandboxEntityIds
 

Additional Inherited Members

- Protected Attributes inherited from Wikibase\Repo\Api\ModifyEntity
 $stringNormalizer
 
 $siteLinkGlobalIdentifiersProvider
 
 $siteLinkGroups
 
 $badgeItems
 
 $errorReporter
 
 $enabledEntityTypes
 

Detailed Description

API module to set the label for a Wikibase entity.

Requires API write mode to be enabled.

Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >
John Erling Blad < jebla.nosp@m.d@gm.nosp@m.ail.c.nosp@m.om >
Tobias Gritschacher < tobia.nosp@m.s.gr.nosp@m.itsch.nosp@m.ache.nosp@m.r@wik.nosp@m.imed.nosp@m.ia.de >

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Api\SetLabel::__construct ( ApiMain  $mainModule,
string  $moduleName,
FingerprintChangeOpFactory  $termChangeOpFactory,
bool  $federatedPropertiesEnabled,
EntityFactory  $entityFactory,
array  $sandboxEntityIds 
)

Member Function Documentation

◆ factory()

static Wikibase\Repo\Api\SetLabel::factory ( ApiMain  $mainModule,
string  $moduleName,
ChangeOpFactoryProvider  $changeOpFactoryProvider,
EntityFactory  $entityFactory,
SettingsArray  $repoSettings 
)
static

◆ getAllowedParams()

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

Reimplemented from Wikibase\Repo\Api\ModifyTerm.

◆ getChangeOp()

Wikibase\Repo\Api\SetLabel::getChangeOp ( array  $preparedParameters,
EntityDocument  $entity 
)
protected
Parameters
array$preparedParameters
EntityDocument$entity
Returns
ChangeOp

Reimplemented from Wikibase\Repo\Api\ModifyEntity.

◆ getEntityTypesWithLabels()

Wikibase\Repo\Api\SetLabel::getEntityTypesWithLabels ( )
protected

◆ getExamplesMessages()

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

◆ isWriteMode()

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

◆ modifyEntity()

Wikibase\Repo\Api\SetLabel::modifyEntity ( EntityDocument  $entity,
ChangeOp  $changeOp,
array  $preparedParameters 
)
protected

Actually modify the entity.

Parameters
EntityDocument$entity
ChangeOp$changeOp
array$preparedParameters
Returns
Summary|null a summary of the modification, or null to indicate failure.

Reimplemented from Wikibase\Repo\Api\ModifyEntity.

◆ needsToken()

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

Member Data Documentation

◆ $entityFactory

Wikibase\Repo\Api\SetLabel::$entityFactory
private

◆ $sandboxEntityIds

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

◆ $termChangeOpFactory

Wikibase\Repo\Api\SetLabel::$termChangeOpFactory
private

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