Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
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, LanguageFallbackChain $languageFallbackChain, $trackUsagesInAllLanguages)
 
 getLabel (EntityId $entityId)
 
 getDescription (EntityId $entityId)
 

Private Member Functions

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

Private Attributes

 $labelDescriptionLookup
 
 $usageAccumulator
 
 $languageFallbackChain
 
 $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,
LanguageFallbackChain  $languageFallbackChain,
  $trackUsagesInAllLanguages 
)
Parameters
FallbackLabelDescriptionLookup$labelDescriptionLookup
UsageAccumulator$usageAccumulator
LanguageFallbackChain$languageFallbackChain
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 LanguageFallbackChain used to get a given TermFallback.

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

Member Data Documentation

◆ $labelDescriptionLookup

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

◆ $languageFallbackChain

Wikibase\Client\Usage\UsageTrackingLanguageFallbackLabelDescriptionLookup::$languageFallbackChain
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: