Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Lib\Store\CachingPrefetchingTermLookup Class Reference

Prefetches terms from the UncachedTermsPrefetcher which stores the terms in the CacheInterface. More...

+ Inheritance diagram for Wikibase\Lib\Store\CachingPrefetchingTermLookup:
+ Collaboration diagram for Wikibase\Lib\Store\CachingPrefetchingTermLookup:

Public Member Functions

 __construct (CacheInterface $cache, UncachedTermsPrefetcher $termsPrefetcher, RedirectResolvingLatestRevisionLookup $redirectResolvingRevisionLookup, ContentLanguages $termLanguages)
 
 prefetchTerms (array $entityIds, array $termTypes, array $languageCodes)
 
 getPrefetchedTerm (EntityId $entityId, $termType, $languageCode)
 
 getLabel (EntityId $entityId, $languageCode)
 
 getLabels (EntityId $entityId, array $languageCodes)
 
 getDescription (EntityId $entityId, $languageCode)
 
 getDescriptions (EntityId $entityId, array $languageCodes)
 
 getPrefetchedAliases (EntityId $entityId, $languageCode)
 Returns terms that were previously loaded by prefetchTerms.
 

Private Member Functions

 getCacheKey (EntityId $id, string $language, string $termType)
 
 getCacheEntry (EntityId $entityId, string $termType, string $languageCode)
 
 getMultipleTermsByLanguage (EntityId $entityId, string $termType, array $languages)
 
 filterValidTermLanguages (array $languageCodes)
 

Private Attributes

 $cache
 
 $termsPrefetcher
 
 $redirectResolvingRevisionLookup
 
 $termLanguages
 

Detailed Description

Prefetches terms from the UncachedTermsPrefetcher which stores the terms in the CacheInterface.

Looks up terms from CacheInterface.

For this reason CacheInterface MUST be a real cache (can store for at least this 1 request).

CacheInterface determines the medium of caching, and thus the availability (process, server, WAN). UncachedTermsPrefetcher controls the ttl of the cached data.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Store\CachingPrefetchingTermLookup::__construct ( CacheInterface  $cache,
UncachedTermsPrefetcher  $termsPrefetcher,
RedirectResolvingLatestRevisionLookup  $redirectResolvingRevisionLookup,
ContentLanguages  $termLanguages 
)
Parameters
CacheInterface$cacheThis must actually be a functioning cache, that can at least cache things within the current request. This is because the UncachedTermsPrefetcher uses the cache to pass data back to this class. If you do not have a cache you should be using PrefetchingPropertyTermLookup directly.
UncachedTermsPrefetcher$termsPrefetcher
RedirectResolvingLatestRevisionLookup$redirectResolvingRevisionLookup
ContentLanguages$termLanguages

Member Function Documentation

◆ filterValidTermLanguages()

Wikibase\Lib\Store\CachingPrefetchingTermLookup::filterValidTermLanguages ( array  $languageCodes)
private

◆ getCacheEntry()

Wikibase\Lib\Store\CachingPrefetchingTermLookup::getCacheEntry ( EntityId  $entityId,
string  $termType,
string  $languageCode 
)
private

◆ getCacheKey()

Wikibase\Lib\Store\CachingPrefetchingTermLookup::getCacheKey ( EntityId  $id,
string  $language,
string  $termType 
)
private

◆ getDescription()

Wikibase\Lib\Store\CachingPrefetchingTermLookup::getDescription ( EntityId  $entityId,
  $languageCode 
)

◆ getDescriptions()

Wikibase\Lib\Store\CachingPrefetchingTermLookup::getDescriptions ( EntityId  $entityId,
array  $languageCodes 
)

◆ getLabel()

Wikibase\Lib\Store\CachingPrefetchingTermLookup::getLabel ( EntityId  $entityId,
  $languageCode 
)

◆ getLabels()

Wikibase\Lib\Store\CachingPrefetchingTermLookup::getLabels ( EntityId  $entityId,
array  $languageCodes 
)

◆ getMultipleTermsByLanguage()

Wikibase\Lib\Store\CachingPrefetchingTermLookup::getMultipleTermsByLanguage ( EntityId  $entityId,
string  $termType,
array  $languages 
)
private

◆ getPrefetchedAliases()

Wikibase\Lib\Store\CachingPrefetchingTermLookup::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\Lib\Store\CachingPrefetchingTermLookup::getPrefetchedTerm ( EntityId  $entityId,
  $termType,
  $languageCode 
)

◆ prefetchTerms()

Wikibase\Lib\Store\CachingPrefetchingTermLookup::prefetchTerms ( array  $entityIds,
array  $termTypes,
array  $languageCodes 
)

Member Data Documentation

◆ $cache

Wikibase\Lib\Store\CachingPrefetchingTermLookup::$cache
private

◆ $redirectResolvingRevisionLookup

Wikibase\Lib\Store\CachingPrefetchingTermLookup::$redirectResolvingRevisionLookup
private

◆ $termLanguages

Wikibase\Lib\Store\CachingPrefetchingTermLookup::$termLanguages
private

◆ $termsPrefetcher

Wikibase\Lib\Store\CachingPrefetchingTermLookup::$termsPrefetcher
private

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