Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\FederatedProperties\ApiEntityLookup Class Reference

A class that handles fetching and in-memory caching of entities. More...

Public Member Functions

 __construct (GenericActionApiClient $api)
 
 fetchEntities (array $entityIds)
 Fetches entities from the source and stores the result in cache. More...
 
 getResultPartForId (EntityId $entityId)
 Getter for the the federated entity result data. More...
 

Private Member Functions

 getEntitiesToFetch (array $entityIds)
 
 getEntities (array $entityIds)
 

Private Attributes

 $api
 
 $lookupCache = []
 

Detailed Description

A class that handles fetching and in-memory caching of entities.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\FederatedProperties\ApiEntityLookup::__construct ( GenericActionApiClient  $api)

Member Function Documentation

◆ fetchEntities()

Wikibase\Repo\FederatedProperties\ApiEntityLookup::fetchEntities ( array  $entityIds)

Fetches entities from the source and stores the result in cache.

Parameters
EntityId[]$entityIds

◆ getEntities()

Wikibase\Repo\FederatedProperties\ApiEntityLookup::getEntities ( array  $entityIds)
private
Parameters
EntityId[]$entityIds
Returns
array the json_decoded part of the wbgetentities API response for the entity.

◆ getEntitiesToFetch()

Wikibase\Repo\FederatedProperties\ApiEntityLookup::getEntitiesToFetch ( array  $entityIds)
private
Parameters
EntityId[]$entityIds
Returns
EntityId[]

◆ getResultPartForId()

Wikibase\Repo\FederatedProperties\ApiEntityLookup::getResultPartForId ( EntityId  $entityId)

Getter for the the federated entity result data.

If not currently in cache it will make a new request.

Parameters
EntityId$entityId
Returns
array containing the part of the wbgetentities response for the given entity id

Member Data Documentation

◆ $api

Wikibase\Repo\FederatedProperties\ApiEntityLookup::$api
private

◆ $lookupCache

Wikibase\Repo\FederatedProperties\ApiEntityLookup::$lookupCache = []
private

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