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

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

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

Public Member Functions

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

Static Public Member Functions

static factory (ApiMain $mainModule, string $moduleName, IBufferingStatsdDataFactory $stats, EntityFactory $entityFactory)
 

Protected Member Functions

 validateParameters (array $params)
 
 modifyEntity (EntityDocument $entity, ChangeOp $changeOp, array $preparedParameters)
 Actually modify the entity. More...
 
 getChangeOp (array $preparedParameters, EntityDocument $entity)
 
 getAllowedParams ()
 
 getEntityTypesWithAliases ()
 
 getExamplesMessages ()
 
- Protected Member Functions inherited from Wikibase\Repo\Api\ModifyEntity
 getTitleLookup ()
 
 getResultBuilder ()
 
 createSummary (array $params)
 Create a new Summary instance suitable for representing the action performed by this module. More...
 
 applyChangeOp (ChangeOp $changeOp, EntityDocument $entity, Summary $summary=null)
 Applies the given ChangeOp to the given Entity. More...
 
 prepareParameters (array $params)
 
 validateEntitySpecificParameters (array $preparedParameters, EntityDocument $entity, int $baseRevId)
 

Private Member Functions

 adjustSummary (Summary $summary, array $params, AliasesProvider $entity)
 
 normalizeAliases (array $aliases)
 

Private Attributes

 $termChangeOpFactory
 
 $stats
 
 $entityFactory
 

Additional Inherited Members

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

Detailed Description

API module to set the aliases for a Wikibase entity.

Requires API write mode to be enabled.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Api\SetAliases::__construct ( ApiMain  $mainModule,
string  $moduleName,
FingerprintChangeOpFactory  $termChangeOpFactory,
IBufferingStatsdDataFactory  $stats,
bool  $federatedPropertiesEnabled,
EntityFactory  $entityFactory 
)

Member Function Documentation

◆ adjustSummary()

Wikibase\Repo\Api\SetAliases::adjustSummary ( Summary  $summary,
array  $params,
AliasesProvider  $entity 
)
private

◆ factory()

static Wikibase\Repo\Api\SetAliases::factory ( ApiMain  $mainModule,
string  $moduleName,
IBufferingStatsdDataFactory  $stats,
EntityFactory  $entityFactory 
)
static

◆ getAllowedParams()

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

Reimplemented from Wikibase\Repo\Api\ModifyEntity.

◆ getChangeOp()

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

Reimplemented from Wikibase\Repo\Api\ModifyEntity.

◆ getEntityTypesWithAliases()

Wikibase\Repo\Api\SetAliases::getEntityTypesWithAliases ( )
protected

◆ getExamplesMessages()

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

◆ isWriteMode()

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

◆ modifyEntity()

Wikibase\Repo\Api\SetAliases::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\SetAliases::needsToken ( )
See also
ApiBase::needsToken
Returns
string

◆ normalizeAliases()

Wikibase\Repo\Api\SetAliases::normalizeAliases ( array  $aliases)
private
Parameters
string[]$aliases
Returns
string[]

◆ validateParameters()

Wikibase\Repo\Api\SetAliases::validateParameters ( array  $params)
protected
See also
ModifyEntity::validateParameters
Parameters
array$params
Exceptions
ApiUsageException

Reimplemented from Wikibase\Repo\Api\ModifyEntity.

Member Data Documentation

◆ $entityFactory

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

◆ $stats

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

◆ $termChangeOpFactory

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

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