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, $moduleName, StringNormalizer $stringNormalizer, LanguageFallbackChainFactory $languageFallbackChainFactory, SiteLinkTargetProvider $siteLinkTargetProvider, EntityPrefetcher $entityPrefetcher, array $siteLinkGroups, ApiErrorReporter $errorReporter, ResultBuilder $resultBuilder, EntityRevisionLookup $entityRevisionLookup, EntityIdParser $idParser, bool $federatedPropertiesEnabled)
 
 execute ()
 

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, $resolveRedirects=false)
 
 getEntityRevision (EntityId $entityId, $resolveRedirects=false)
 
 handleEntity ( $sourceEntityId, EntityRevision $entityRevision=null, array $params=[])
 Adds the given EntityRevision to the API result.
 
 getLanguageCodesAndFallback (array $params)
 

Private Attributes

 $stringNormalizer
 
 $languageFallbackChainFactory
 
 $siteLinkTargetProvider
 
 $entityPrefetcher
 
 $siteLinkGroups
 
 $resultBuilder
 
 $entityRevisionLookup
 
 $idParser
 

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,
  $moduleName,
StringNormalizer  $stringNormalizer,
LanguageFallbackChainFactory  $languageFallbackChainFactory,
SiteLinkTargetProvider  $siteLinkTargetProvider,
EntityPrefetcher  $entityPrefetcher,
array  $siteLinkGroups,
ApiErrorReporter  $errorReporter,
ResultBuilder  $resultBuilder,
EntityRevisionLookup  $entityRevisionLookup,
EntityIdParser  $idParser,
bool  $federatedPropertiesEnabled 
)
Parameters
ApiMain$mainModule
string$moduleName
StringNormalizer$stringNormalizer
LanguageFallbackChainFactory$languageFallbackChainFactory
SiteLinkTargetProvider$siteLinkTargetProvider
EntityPrefetcher$entityPrefetcher
string[]$siteLinkGroups
ApiErrorReporter$errorReporter
ResultBuilder$resultBuilder
EntityRevisionLookup$entityRevisionLookup
EntityIdParser$idParser
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 ( )

◆ 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,
  $resolveRedirects = false 
)
private
Parameters
EntityId$entityId
bool$resolveRedirects
Returns
null|EntityRevision

◆ getEntityRevisionsFromEntityIds()

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

◆ getExamplesMessages()

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

◆ getItemByTitleHelper()

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

◆ getLanguageCodesAndFallback()

Wikibase\Repo\Api\GetEntities::getLanguageCodesAndFallback ( array  $params)
private
Parameters
array$params
Returns
array 0 => string[] languageCodes that the user wants returned 1 => LanguageFallbackChain[] 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 (   $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

◆ $siteLinkGroups

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

◆ $siteLinkTargetProvider

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

◆ $stringNormalizer

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

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