Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
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 $ids)
 Fetches entities from the source and stores the result in cache.
 
 getResultPartForId (FederatedPropertyId $id)
 Getter for the federated entity result data.
 
 getFederatedEntityIdsWithoutPrefix (array $federatedEntityIds)
 

Private Member Functions

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

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 $ids)

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

Parameters
FederatedPropertyId[]$ids

◆ getEntities()

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

◆ getEntitiesToFetch()

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

◆ getFederatedEntityIdsWithoutPrefix()

Wikibase\Repo\FederatedProperties\ApiEntityLookup::getFederatedEntityIdsWithoutPrefix ( array $federatedEntityIds)
Parameters
FederatedPropertyId[]$federatedEntityIds
Returns
string[]

◆ getResultPartForId()

Wikibase\Repo\FederatedProperties\ApiEntityLookup::getResultPartForId ( FederatedPropertyId $id)

Getter for the federated entity result data.

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

Parameters
FederatedPropertyId$id
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: