Wikibase
MediaWiki Wikibase extension
Wikibase\DataAccess\ByTypeDispatchingPrefetchingTermLookup Class Reference

TODO: PrefetchingTermLookup is an odd interface, it describes two different resposbilities really. More...

+ Inheritance diagram for Wikibase\DataAccess\ByTypeDispatchingPrefetchingTermLookup:
+ Collaboration diagram for Wikibase\DataAccess\ByTypeDispatchingPrefetchingTermLookup:

Public Member Functions

 __construct (array $lookups, PrefetchingTermLookup $defaultLookup=null)
 
 prefetchTerms (array $entityIds, array $termTypes, array $languageCodes)
 
 getPrefetchedTerm (EntityId $entityId, $termType, $languageCode)
 
 getPrefetchedAliases (EntityId $entityId, $languageCode)
 Returns terms that were previously loaded by prefetchTerms. More...
 
- Public Member Functions inherited from Wikibase\Lib\Store\EntityTermLookupBase
 getLabel (EntityId $entityId, $languageCode)
 
 getLabels (EntityId $entityId, array $languageCodes)
 
 getDescription (EntityId $entityId, $languageCode)
 
 getDescriptions (EntityId $entityId, array $languageCodes)
 

Protected Member Functions

 getTermsOfType (EntityId $entityId, $termType, array $languageCodes)
 Gets the text string terms for a given type. More...
 
- Protected Member Functions inherited from Wikibase\Lib\Store\EntityTermLookupBase
 convertTermsToMap (array $wikibaseTerms)
 

Private Member Functions

 groupEntityIdsByType (array $entityIds)
 
 getLookupForEntityType ( $entityType)
 

Private Attributes

 $lookups
 
 $defaultLookup
 

Detailed Description

TODO: PrefetchingTermLookup is an odd interface, it describes two different resposbilities really.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\DataAccess\ByTypeDispatchingPrefetchingTermLookup::__construct ( array  $lookups,
PrefetchingTermLookup  $defaultLookup = null 
)
Parameters
PrefetchingTermLookup[]$lookups
PrefetchingTermLookup | null$defaultLookup

Member Function Documentation

◆ getLookupForEntityType()

Wikibase\DataAccess\ByTypeDispatchingPrefetchingTermLookup::getLookupForEntityType (   $entityType)
private
Parameters
string$entityType
Returns
PrefetchingTermLookup|null

◆ getPrefetchedAliases()

Wikibase\DataAccess\ByTypeDispatchingPrefetchingTermLookup::getPrefetchedAliases ( EntityId  $entityId,
  $languageCode 
)

Returns terms that were previously loaded by prefetchTerms.

Parameters
EntityId$entityId
string$languageCode
Returns
string[]|false|null The aliases, or false of that entity has no aliases, or null if the term was not yet requested via prefetchTerms().

Implements Wikibase\DataAccess\AliasTermBuffer.

◆ getPrefetchedTerm()

Wikibase\DataAccess\ByTypeDispatchingPrefetchingTermLookup::getPrefetchedTerm ( EntityId  $entityId,
  $termType,
  $languageCode 
)

◆ getTermsOfType()

Wikibase\DataAccess\ByTypeDispatchingPrefetchingTermLookup::getTermsOfType ( EntityId  $entityId,
  $termType,
array  $languageCodes 
)
protected

Gets the text string terms for a given type.

If aliases are requested here you will only receive a single string.

Parameters
EntityId$entityId
string$termType
string[]$languageCodesThe languages to get terms for
Returns
string[] Normally indexed by language code

Reimplemented from Wikibase\Lib\Store\EntityTermLookupBase.

◆ groupEntityIdsByType()

Wikibase\DataAccess\ByTypeDispatchingPrefetchingTermLookup::groupEntityIdsByType ( array  $entityIds)
private

◆ prefetchTerms()

Wikibase\DataAccess\ByTypeDispatchingPrefetchingTermLookup::prefetchTerms ( array  $entityIds,
array  $termTypes,
array  $languageCodes 
)
Parameters
EntityId[]$entityIds
string[] | null$termTypes
string[] | null$languageCodes

Member Data Documentation

◆ $defaultLookup

Wikibase\DataAccess\ByTypeDispatchingPrefetchingTermLookup::$defaultLookup
private

◆ $lookups

Wikibase\DataAccess\ByTypeDispatchingPrefetchingTermLookup::$lookups
private

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