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

Factory to create a FallbackLabelDescriptionLookup that also resolves redirects. More...

Public Member Functions

 __construct (LanguageFallbackChainFactory $languageFallbackChainFactory, RedirectResolvingLatestRevisionLookup $redirectResolvingLatestRevisionLookup, TermFallbackCacheFacade $termFallbackCache, TermLookup $termLookup, TermBuffer $termBuffer=null)
 $termBuffer will be used to prefetch terms if it is provided; in that case, $termLookup should be based on it (they may even be the same object, a PrefetchingTermLookup).
 
 newLabelDescriptionLookup (Language $language, array $entityIds=[], array $termTypes=[TermTypes::TYPE_LABEL])
 Create a new LabelDescriptionLookup in the given language that applies language fallbacks, resolves redirects, and has the given entity ID term types (if any) prefetched.
 

Private Attributes

 $languageFallbackChainFactory
 
 $redirectResolvingRevisionLookup
 
 $termFallbackCache
 
 $termLookup
 
 $termBuffer
 

Detailed Description

Factory to create a FallbackLabelDescriptionLookup that also resolves redirects.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Store\FallbackLabelDescriptionLookupFactory::__construct ( LanguageFallbackChainFactory $languageFallbackChainFactory,
RedirectResolvingLatestRevisionLookup $redirectResolvingLatestRevisionLookup,
TermFallbackCacheFacade $termFallbackCache,
TermLookup $termLookup,
TermBuffer $termBuffer = null )

$termBuffer will be used to prefetch terms if it is provided; in that case, $termLookup should be based on it (they may even be the same object, a PrefetchingTermLookup).

Member Function Documentation

◆ newLabelDescriptionLookup()

Wikibase\Lib\Store\FallbackLabelDescriptionLookupFactory::newLabelDescriptionLookup ( Language $language,
array $entityIds = [],
array $termTypes = [ TermTypes::TYPE_LABEL ] )

Create a new LabelDescriptionLookup in the given language that applies language fallbacks, resolves redirects, and has the given entity ID term types (if any) prefetched.

Parameters
Language$language
EntityId[]$entityIdsEntity IDs to prefetch terms for, if any. Only relevant if the factory was constructed with a TermBuffer.
string[]$termTypesTerm types to prefetch (default: only labels). One or more TermTypes constants.
Returns
FallbackLabelDescriptionLookup

Member Data Documentation

◆ $languageFallbackChainFactory

Wikibase\Lib\Store\FallbackLabelDescriptionLookupFactory::$languageFallbackChainFactory
private

◆ $redirectResolvingRevisionLookup

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

◆ $termBuffer

Wikibase\Lib\Store\FallbackLabelDescriptionLookupFactory::$termBuffer
private

◆ $termFallbackCache

Wikibase\Lib\Store\FallbackLabelDescriptionLookupFactory::$termFallbackCache
private

◆ $termLookup

Wikibase\Lib\Store\FallbackLabelDescriptionLookupFactory::$termLookup
private

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