Wikibase
MediaWiki Wikibase extension
Wikibase\Client\Usage\UsageTrackingLanguageFallbackLabelDescriptionLookup Class Reference

LanguageFallbackLabelDescriptionLookup decorator that records label usage in an UsageAccumulator. More...

+ Inheritance diagram for Wikibase\Client\Usage\UsageTrackingLanguageFallbackLabelDescriptionLookup:
+ Collaboration diagram for Wikibase\Client\Usage\UsageTrackingLanguageFallbackLabelDescriptionLookup:

Public Member Functions

 __construct (FallbackLabelDescriptionLookup $labelDescriptionLookup, UsageAccumulator $usageAccumulator, TermLanguageFallbackChain $termLanguageFallbackChain, $trackUsagesInAllLanguages)
 
 getLabel (EntityId $entityId)
 
 getDescription (EntityId $entityId)
 

Private Member Functions

 getTouchedLanguages (TermFallback $termFallback=null)
 Get the languages from the TermLanguageFallbackChain used to get a given TermFallback. More...
 

Private Attributes

 $labelDescriptionLookup
 
 $usageAccumulator
 
 $termLanguageFallbackChain
 
 $trackUsagesInAllLanguages
 

Detailed Description

LanguageFallbackLabelDescriptionLookup decorator that records label usage in an UsageAccumulator.

See also
UsageAccumulator
Author
Marius Hoch

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\Usage\UsageTrackingLanguageFallbackLabelDescriptionLookup::__construct ( FallbackLabelDescriptionLookup  $labelDescriptionLookup,
UsageAccumulator  $usageAccumulator,
TermLanguageFallbackChain  $termLanguageFallbackChain,
  $trackUsagesInAllLanguages 
)
Parameters
FallbackLabelDescriptionLookup$labelDescriptionLookup
UsageAccumulator$usageAccumulator
TermLanguageFallbackChain$termLanguageFallbackChain
bool$trackUsagesInAllLanguages

Member Function Documentation

◆ getDescription()

Wikibase\Client\Usage\UsageTrackingLanguageFallbackLabelDescriptionLookup::getDescription ( EntityId  $entityId)
Parameters
EntityId$entityId
Exceptions
LabelDescriptionLookupException
Returns
TermFallback|null

Implements Wikibase\Lib\Store\FallbackLabelDescriptionLookup.

◆ getLabel()

Wikibase\Client\Usage\UsageTrackingLanguageFallbackLabelDescriptionLookup::getLabel ( EntityId  $entityId)
Parameters
EntityId$entityId
Exceptions
LabelDescriptionLookupException
Returns
TermFallback|null

Implements Wikibase\Lib\Store\FallbackLabelDescriptionLookup.

◆ getTouchedLanguages()

Wikibase\Client\Usage\UsageTrackingLanguageFallbackLabelDescriptionLookup::getTouchedLanguages ( TermFallback  $termFallback = null)
private

Get the languages from the TermLanguageFallbackChain used to get a given TermFallback.

Parameters
TermFallback | null$termFallback
Returns
string[]|null[]

Member Data Documentation

◆ $labelDescriptionLookup

Wikibase\Client\Usage\UsageTrackingLanguageFallbackLabelDescriptionLookup::$labelDescriptionLookup
private

◆ $termLanguageFallbackChain

Wikibase\Client\Usage\UsageTrackingLanguageFallbackLabelDescriptionLookup::$termLanguageFallbackChain
private

◆ $trackUsagesInAllLanguages

Wikibase\Client\Usage\UsageTrackingLanguageFallbackLabelDescriptionLookup::$trackUsagesInAllLanguages
private

◆ $usageAccumulator

Wikibase\Client\Usage\UsageTrackingLanguageFallbackLabelDescriptionLookup::$usageAccumulator
private

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