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

A FallbackLabelDescriptionLookup that dispatches between two other lookups, using one for federated property IDs and one for everything else. More...

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

Public Member Functions

 __construct (FallbackLabelDescriptionLookup $standardLookup, FallbackLabelDescriptionLookup $federatedPropertiesLookup)
 
 getLabel (EntityId $entityId)
 
 getDescription (EntityId $entityId)
 

Private Member Functions

 getLookup (EntityId $entityId)
 

Private Attributes

 $standardLookup
 
 $federatedPropertiesLookup
 

Detailed Description

A FallbackLabelDescriptionLookup that dispatches between two other lookups, using one for federated property IDs and one for everything else.

This is necessary because the lookup implementation we want to use for most entity IDs, CachingFallbackLabelDescriptionLookup, does not support federated properties, because it requires an EntityRevisionLookup (to get the latest revision ID for the cache key), which is not available for federated properties as of July 2022.

This class should only be used by FallbackLabelDescriptionLookupFactory. Do not use it directly. Once the standard lookup supports federated properties, this class can hopefully be removed again.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Store\DispatchingFallbackLabelDescriptionLookup::__construct ( FallbackLabelDescriptionLookup  $standardLookup,
FallbackLabelDescriptionLookup  $federatedPropertiesLookup 
)
Parameters
FallbackLabelDescriptionLookup$standardLookupThe lookup used for most entity IDs. Usually a CachingFallbackLabelDescriptionLookup.
FallbackLabelDescriptionLookup$federatedPropertiesLookupThe lookup used for federated property IDs. Usually a LanguageFallbackLabelDescriptionLookup.

Member Function Documentation

◆ getDescription()

Wikibase\Lib\Store\DispatchingFallbackLabelDescriptionLookup::getDescription ( EntityId  $entityId)
Parameters
EntityId$entityId
Exceptions
LabelDescriptionLookupException
Returns
TermFallback|null

Implements Wikibase\Lib\Store\FallbackLabelDescriptionLookup.

◆ getLabel()

Wikibase\Lib\Store\DispatchingFallbackLabelDescriptionLookup::getLabel ( EntityId  $entityId)
Parameters
EntityId$entityId
Exceptions
LabelDescriptionLookupException
Returns
TermFallback|null

Implements Wikibase\Lib\Store\FallbackLabelDescriptionLookup.

◆ getLookup()

Wikibase\Lib\Store\DispatchingFallbackLabelDescriptionLookup::getLookup ( EntityId  $entityId)
private

Member Data Documentation

◆ $federatedPropertiesLookup

Wikibase\Lib\Store\DispatchingFallbackLabelDescriptionLookup::$federatedPropertiesLookup
private

◆ $standardLookup

Wikibase\Lib\Store\DispatchingFallbackLabelDescriptionLookup::$standardLookup
private

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