Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Client\Hooks\Formatter\ClientEntityLinkFormatter Class Reference
+ Collaboration diagram for Wikibase\Client\Hooks\Formatter\ClientEntityLinkFormatter:

Public Member Functions

 __construct (LanguageFactory $languageFactory)
 
 getHtml (EntityId $entityId, Language $pageLanguage, ?array $labelData=null)
 Returns a formatted HTML string containing the localized entity label and id.
 
 getTitleAttribute (Language $pageLanguage, ?array $labelData=null, ?array $descriptionData=null)
 Creates a formatted string containing the localized entity label and description to be displayed on link hover.
 

Private Member Functions

 extractTextAndLanguage (?array $termData, Language $pageLanguage)
 

Private Attributes

LanguageFactory $languageFactory
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\Hooks\Formatter\ClientEntityLinkFormatter::__construct ( LanguageFactory $languageFactory)
Parameters
LanguageFactory$languageFactory

Member Function Documentation

◆ extractTextAndLanguage()

Wikibase\Client\Hooks\Formatter\ClientEntityLinkFormatter::extractTextAndLanguage ( ?array $termData,
Language $pageLanguage )
private
Parameters
string[] | null$termDataA term record as returned by TermLanguageFallbackChain::extractPreferredValueOrAny(), containing the 'value' and 'language' fields, or null or an empty array.
Returns
array{0: string, 1: Language}
See also
TermLanguageFallbackChain::extractPreferredValueOrAny

◆ getHtml()

Wikibase\Client\Hooks\Formatter\ClientEntityLinkFormatter::getHtml ( EntityId $entityId,
Language $pageLanguage,
?array $labelData = null )

Returns a formatted HTML string containing the localized entity label and id.

Parameters
EntityId$entityId
Language$pageLanguage
array | null$labelDataarray containing the label's text and language
Returns
string

◆ getTitleAttribute()

Wikibase\Client\Hooks\Formatter\ClientEntityLinkFormatter::getTitleAttribute ( Language $pageLanguage,
?array $labelData = null,
?array $descriptionData = null )

Creates a formatted string containing the localized entity label and description to be displayed on link hover.

Parameters
Language$pageLanguage
array | null$labelDataarray containing the label's text and language
array | null$descriptionDataarray containing the description's text and language
Returns
string|null

Member Data Documentation

◆ $languageFactory

LanguageFactory Wikibase\Client\Hooks\Formatter\ClientEntityLinkFormatter::$languageFactory
private

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