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

Enables accessing items by providing the label of the item and the language of the label. More...

+ Inheritance diagram for Wikibase\Repo\Specials\SpecialItemDisambiguation:
+ Collaboration diagram for Wikibase\Repo\Specials\SpecialItemDisambiguation:

Public Member Functions

 __construct (EntitySearchHelper $entitySearchHelper, ItemDisambiguationFactory $itemDisambiguationFactory, LanguageNameLookupFactory $languageNameLookupFactory, ContentLanguages $contentLanguages)
 
 execute ( $subPage)
 
- Public Member Functions inherited from Wikibase\Repo\Specials\SpecialWikibasePage
 __construct ( $name='', $restriction='', $listed=true)
 
 getDescription ()
 
 setHeaders ()
 

Private Member Functions

 extractLanguageCode (WebRequest $request, array $subPageParts)
 
 extractLabel (WebRequest $request, array $subPageParts)
 
 displaySearchResults (array $searchResults, string $label)
 
 getSearchResults (string $label, string $languageCode)
 
 showNothingFound (string $languageCode, string $label)
 Shows information, assuming no results were found.
 
 displayDisambiguationPage (array $searchResults)
 Display disambiguation page.
 
 getLanguageOptions ()
 Return options for the language input field.
 
 switchForm (?string $languageCode, ?string $label)
 Output a form to allow searching for labels.
 

Private Attributes

const LIMIT = 100
 
EntitySearchHelper $entitySearchHelper
 
ItemDisambiguationFactory $itemDisambiguationFactory
 
LanguageNameLookupFactory $languageNameLookupFactory
 
ContentLanguages $contentLanguages
 

Additional Inherited Members

- Protected Member Functions inherited from Wikibase\Repo\Specials\SpecialWikibasePage
 getGroupName ()
 
 checkBlocked ()
 Checks if user is blocked, and if blocked throws a UserBlocked.
 
 showErrorHTML ( $error)
 
- Protected Attributes inherited from Wikibase\Repo\Specials\SpecialWikibasePage
 $stringNormalizer
 

Detailed Description

Enables accessing items by providing the label of the item and the language of the label.

A result page is shown, disambiguating between multiple results if necessary.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Specials\SpecialItemDisambiguation::__construct ( EntitySearchHelper $entitySearchHelper,
ItemDisambiguationFactory $itemDisambiguationFactory,
LanguageNameLookupFactory $languageNameLookupFactory,
ContentLanguages $contentLanguages )

Member Function Documentation

◆ displayDisambiguationPage()

Wikibase\Repo\Specials\SpecialItemDisambiguation::displayDisambiguationPage ( array $searchResults)
private

Display disambiguation page.

Parameters
TermSearchResult[]$searchResults

◆ displaySearchResults()

Wikibase\Repo\Specials\SpecialItemDisambiguation::displaySearchResults ( array $searchResults,
string $label )
private
Parameters
TermSearchResult[]$searchResults
string$label

◆ execute()

Wikibase\Repo\Specials\SpecialItemDisambiguation::execute ( $subPage)
See also
SpecialWikibasePage::execute
Parameters
string | null$subPage

Reimplemented from Wikibase\Repo\Specials\SpecialWikibasePage.

◆ extractLabel()

Wikibase\Repo\Specials\SpecialItemDisambiguation::extractLabel ( WebRequest $request,
array $subPageParts )
private

◆ extractLanguageCode()

Wikibase\Repo\Specials\SpecialItemDisambiguation::extractLanguageCode ( WebRequest $request,
array $subPageParts )
private

◆ getLanguageOptions()

Wikibase\Repo\Specials\SpecialItemDisambiguation::getLanguageOptions ( )
private

Return options for the language input field.

◆ getSearchResults()

Wikibase\Repo\Specials\SpecialItemDisambiguation::getSearchResults ( string $label,
string $languageCode )
private
Parameters
string$label
string$languageCode
Returns
TermSearchResult[]
Exceptions
EntitySearchException

◆ showNothingFound()

Wikibase\Repo\Specials\SpecialItemDisambiguation::showNothingFound ( string $languageCode,
string $label )
private

Shows information, assuming no results were found.

◆ switchForm()

Wikibase\Repo\Specials\SpecialItemDisambiguation::switchForm ( ?string $languageCode,
?string $label )
private

Output a form to allow searching for labels.

Member Data Documentation

◆ $contentLanguages

ContentLanguages Wikibase\Repo\Specials\SpecialItemDisambiguation::$contentLanguages
private

◆ $entitySearchHelper

EntitySearchHelper Wikibase\Repo\Specials\SpecialItemDisambiguation::$entitySearchHelper
private

◆ $itemDisambiguationFactory

ItemDisambiguationFactory Wikibase\Repo\Specials\SpecialItemDisambiguation::$itemDisambiguationFactory
private

◆ $languageNameLookupFactory

LanguageNameLookupFactory Wikibase\Repo\Specials\SpecialItemDisambiguation::$languageNameLookupFactory
private

◆ LIMIT

const Wikibase\Repo\Specials\SpecialItemDisambiguation::LIMIT = 100
private

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