Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\ItemDisambiguation Class Reference

Class representing the disambiguation of a list of WikibaseItems. More...

+ Collaboration diagram for Wikibase\Repo\ItemDisambiguation:

Public Member Functions

 __construct (EntityTitleLookup $titleLookup, LanguageNameLookup $languageNameLookup)
 
 getHTML (array $searchResults)
 Builds and returns the HTML to represent the WikibaseItem.
 
 getResultHtml (TermSearchResult $searchResult)
 

Private Member Functions

 getIdHtml (EntityId $entityId)
 Returns HTML representing the label in the display language (or an appropriate fallback).
 
 getLabelHtml (?Term $label)
 Returns HTML representing the label in the display language (or an appropriate fallback).
 
 getDescriptionHtml (?Term $description)
 Returns HTML representing the description in the display language (or an appropriate fallback).
 
 getMatchHtml (Term $match, ?Term $label)
 Returns HTML representing the matched term in the search language (or an appropriate fallback).
 

Private Attributes

EntityTitleLookup $titleLookup
 
LanguageNameLookup $languageNameLookup
 

Detailed Description

Class representing the disambiguation of a list of WikibaseItems.

See also
ItemDisambiguationFactory

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\ItemDisambiguation::__construct ( EntityTitleLookup $titleLookup,
LanguageNameLookup $languageNameLookup )

Member Function Documentation

◆ getDescriptionHtml()

Wikibase\Repo\ItemDisambiguation::getDescriptionHtml ( ?Term $description)
private

Returns HTML representing the description in the display language (or an appropriate fallback).

Returns
string HTML

◆ getHTML()

Wikibase\Repo\ItemDisambiguation::getHTML ( array $searchResults)

Builds and returns the HTML to represent the WikibaseItem.

Parameters
TermSearchResult[]$searchResults
Returns
string HTML

◆ getIdHtml()

Wikibase\Repo\ItemDisambiguation::getIdHtml ( EntityId $entityId)
private

Returns HTML representing the label in the display language (or an appropriate fallback).

Returns
string HTML

◆ getLabelHtml()

Wikibase\Repo\ItemDisambiguation::getLabelHtml ( ?Term $label)
private

Returns HTML representing the label in the display language (or an appropriate fallback).

Returns
string HTML

◆ getMatchHtml()

Wikibase\Repo\ItemDisambiguation::getMatchHtml ( Term $match,
?Term $label )
private

Returns HTML representing the matched term in the search language (or an appropriate fallback).

The matched text and language are wrapped using the wikibase-itemlink-userlang-wrapper message. If the matched term has the same text as the display label, an empty string is returned.

Returns
string HTML

◆ getResultHtml()

Wikibase\Repo\ItemDisambiguation::getResultHtml ( TermSearchResult $searchResult)
Returns
string HTML

Member Data Documentation

◆ $languageNameLookup

LanguageNameLookup Wikibase\Repo\ItemDisambiguation::$languageNameLookup
private

◆ $titleLookup

EntityTitleLookup Wikibase\Repo\ItemDisambiguation::$titleLookup
private

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