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 (ContentLanguages $contentLanguages, LanguageNameLookup $languageNameLookup, ItemDisambiguation $itemDisambiguation, EntitySearchHelper $entitySearchHelper, $limit=100)
 
 execute ( $subPage)
 
- Public Member Functions inherited from Wikibase\Repo\Specials\SpecialWikibasePage
 __construct ( $name='', $restriction='', $listed=true)
 
 getDescription ()
 
 setHeaders ()
 

Static Public Member Functions

static newFromGlobalState ()
 

Private Member Functions

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

Private Attributes

 $contentLanguages
 
 $languageNameLookup
 
 $itemDisambiguation
 
 $entitySearchHelper
 
 $limit
 

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 ( ContentLanguages  $contentLanguages,
LanguageNameLookup  $languageNameLookup,
ItemDisambiguation  $itemDisambiguation,
EntitySearchHelper  $entitySearchHelper,
  $limit = 100 
)
Parameters
ContentLanguages$contentLanguages
LanguageNameLookup$languageNameLookup
ItemDisambiguation$itemDisambiguation
EntitySearchHelper$entitySearchHelper
int$limit

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,
  $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
Parameters
WebRequest$request
array$subPageParts
Returns
string

◆ extractLanguageCode()

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

◆ getLanguageOptions()

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

Return options for the language input field.

Returns
array

◆ getSearchResults()

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

◆ newFromGlobalState()

static Wikibase\Repo\Specials\SpecialItemDisambiguation::newFromGlobalState ( )
static

◆ showNothingFound()

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

Shows information, assuming no results were found.

Parameters
string$languageCode
string$label

◆ switchForm()

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

Output a form to allow searching for labels.

Parameters
string | null$languageCode
string | null$label

Member Data Documentation

◆ $contentLanguages

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

◆ $entitySearchHelper

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

◆ $itemDisambiguation

Wikibase\Repo\Specials\SpecialItemDisambiguation::$itemDisambiguation
private

◆ $languageNameLookup

Wikibase\Repo\Specials\SpecialItemDisambiguation::$languageNameLookup
private

◆ $limit

Wikibase\Repo\Specials\SpecialItemDisambiguation::$limit
private

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