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

API module to get the data for one or more Wikibase entities. More...

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

Public Member Functions

 __construct (ApiMain $mainModule, string $moduleName, StringNormalizer $stringNormalizer, LanguageFallbackChainFactory $languageFallbackChainFactory, SiteLinkGlobalIdentifiersProvider $siteLinkGlobalIdentifiersProvider, EntityPrefetcher $entityPrefetcher, array $siteLinkGroups, ApiErrorReporter $errorReporter, ResultBuilder $resultBuilder, EntityRevisionLookup $entityRevisionLookup, EntityIdParser $idParser, SiteLookup $siteLookup, IBufferingStatsdDataFactory $stats, bool $federatedPropertiesEnabled)
 
 execute ()
 

Static Public Member Functions

static factory (ApiMain $apiMain, string $moduleName, SiteLookup $siteLookup, IBufferingStatsdDataFactory $stats, ApiHelperFactory $apiHelperFactory, EntityIdParser $entityIdParser, EntityRevisionLookup $entityRevisionLookup, LanguageFallbackChainFactory $languageFallbackChainFactory, SettingsArray $repoSettings, SiteLinkGlobalIdentifiersProvider $siteLinkGlobalIdentifiersProvider, Store $store, StringNormalizer $stringNormalizer)
 

Protected Member Functions

 getAllowedParams ()
 
 getExamplesMessages ()
 

Protected Attributes

 $errorReporter
 

Private Member Functions

 getEntityIdsFromParams (array $params)
 Get a unique array of EntityIds from api request params.
 
 getEntityIdsFromIdParam (array $params)
 
 getEntityIdsFromSiteTitleParams (array $params)
 
 getItemByTitleHelper ()
 
 addMissingItemsToResult (array $missingItems)
 
 getPropsFromParams (array $params)
 Returns props based on request parameters.
 
 getEntityRevisionsFromEntityIds (array $entityIds, bool $resolveRedirects=false)
 
 getEntityRevision (EntityId $entityId, bool $resolveRedirects=false)
 
 handleEntity (?string $sourceEntityId, EntityRevision $entityRevision=null, array $params=[])
 Adds the given EntityRevision to the API result.
 
 getLanguageCodesAndFallback (array $params)
 

Private Attributes

 $stringNormalizer
 
 $languageFallbackChainFactory
 
 $siteLinkGlobalIdentifiersProvider
 
 $entityPrefetcher
 
 $siteLinkGroups
 
 $resultBuilder
 
 $entityRevisionLookup
 
 $idParser
 
 $siteLookup
 
 $stats
 

Detailed Description

API module to get the data for one or more Wikibase entities.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Api\GetEntities::__construct ( ApiMain $mainModule,
string $moduleName,
StringNormalizer $stringNormalizer,
LanguageFallbackChainFactory $languageFallbackChainFactory,
SiteLinkGlobalIdentifiersProvider $siteLinkGlobalIdentifiersProvider,
EntityPrefetcher $entityPrefetcher,
array $siteLinkGroups,
ApiErrorReporter $errorReporter,
ResultBuilder $resultBuilder,
EntityRevisionLookup $entityRevisionLookup,
EntityIdParser $idParser,
SiteLookup $siteLookup,
IBufferingStatsdDataFactory $stats,
bool $federatedPropertiesEnabled )
Parameters
ApiMain$mainModule
string$moduleName
StringNormalizer$stringNormalizer
LanguageFallbackChainFactory$languageFallbackChainFactory
SiteLinkGlobalIdentifiersProvider$siteLinkGlobalIdentifiersProvider
EntityPrefetcher$entityPrefetcher
string[]$siteLinkGroups
ApiErrorReporter$errorReporter
ResultBuilder$resultBuilder
EntityRevisionLookup$entityRevisionLookup
EntityIdParser$idParser
SiteLookup$siteLookup
IBufferingStatsdDataFactory$stats
bool$federatedPropertiesEnabled
See also
ApiBase::__construct

Member Function Documentation

◆ addMissingItemsToResult()

Wikibase\Repo\Api\GetEntities::addMissingItemsToResult ( array $missingItems)
private
Parameters
array[]$missingItemsArray of arrays, Each internal array has a key 'site' and 'title'

◆ execute()

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

◆ factory()

static Wikibase\Repo\Api\GetEntities::factory ( ApiMain $apiMain,
string $moduleName,
SiteLookup $siteLookup,
IBufferingStatsdDataFactory $stats,
ApiHelperFactory $apiHelperFactory,
EntityIdParser $entityIdParser,
EntityRevisionLookup $entityRevisionLookup,
LanguageFallbackChainFactory $languageFallbackChainFactory,
SettingsArray $repoSettings,
SiteLinkGlobalIdentifiersProvider $siteLinkGlobalIdentifiersProvider,
Store $store,
StringNormalizer $stringNormalizer )
static

◆ getAllowedParams()

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

◆ getEntityIdsFromIdParam()

Wikibase\Repo\Api\GetEntities::getEntityIdsFromIdParam ( array $params)
private
Parameters
array$params
Returns
EntityId[]

◆ getEntityIdsFromParams()

Wikibase\Repo\Api\GetEntities::getEntityIdsFromParams ( array $params)
private

Get a unique array of EntityIds from api request params.

Parameters
array$params
Returns
EntityId[]

◆ getEntityIdsFromSiteTitleParams()

Wikibase\Repo\Api\GetEntities::getEntityIdsFromSiteTitleParams ( array $params)
private
Parameters
array$params
Returns
EntityId[]

◆ getEntityRevision()

Wikibase\Repo\Api\GetEntities::getEntityRevision ( EntityId $entityId,
bool $resolveRedirects = false )
private

◆ getEntityRevisionsFromEntityIds()

Wikibase\Repo\Api\GetEntities::getEntityRevisionsFromEntityIds ( array $entityIds,
bool $resolveRedirects = false )
private
Parameters
EntityId[]$entityIds
bool$resolveRedirects
Returns
EntityRevision[]

◆ getExamplesMessages()

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

◆ getItemByTitleHelper()

Wikibase\Repo\Api\GetEntities::getItemByTitleHelper ( )
private

◆ getLanguageCodesAndFallback()

Wikibase\Repo\Api\GetEntities::getLanguageCodesAndFallback ( array $params)
private
Parameters
array$params
Returns
array 0 => string[] languageCodes that the user wants returned 1 => TermLanguageFallbackChain[] Keys are requested lang codes

◆ getPropsFromParams()

Wikibase\Repo\Api\GetEntities::getPropsFromParams ( array $params)
private

Returns props based on request parameters.

Parameters
array$params
Returns
array

◆ handleEntity()

Wikibase\Repo\Api\GetEntities::handleEntity ( ?string $sourceEntityId,
EntityRevision $entityRevision = null,
array $params = [] )
private

Adds the given EntityRevision to the API result.

Parameters
string | null$sourceEntityId
EntityRevision | null$entityRevision
array$params

Member Data Documentation

◆ $entityPrefetcher

Wikibase\Repo\Api\GetEntities::$entityPrefetcher
private

◆ $entityRevisionLookup

Wikibase\Repo\Api\GetEntities::$entityRevisionLookup
private

◆ $errorReporter

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

◆ $idParser

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

◆ $languageFallbackChainFactory

Wikibase\Repo\Api\GetEntities::$languageFallbackChainFactory
private

◆ $resultBuilder

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

◆ $siteLinkGlobalIdentifiersProvider

Wikibase\Repo\Api\GetEntities::$siteLinkGlobalIdentifiersProvider
private

◆ $siteLinkGroups

Wikibase\Repo\Api\GetEntities::$siteLinkGroups
private

◆ $siteLookup

Wikibase\Repo\Api\GetEntities::$siteLookup
private

◆ $stats

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

◆ $stringNormalizer

Wikibase\Repo\Api\GetEntities::$stringNormalizer
private

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