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

EntitySearchHelper decorator that adds an entity concept URI to the TermSearchResult meta data if not already set. More...

+ Inheritance diagram for Wikibase\Repo\Api\ConceptUriSearchHelper:
+ Collaboration diagram for Wikibase\Repo\Api\ConceptUriSearchHelper:

Public Member Functions

 __construct (EntitySearchHelper $searchHelper, EntitySourceDefinitions $entitySourceDefinitions)
 
 getRankedSearchResults ( $text, $languageCode, $entityType, $limit, $strictLanguage)
 Get entities matching the search term.
 

Public Attributes

const CONCEPTURI_META_DATA_KEY = TermSearchResult::CONCEPTURI_META_DATA_KEY
 

Private Member Functions

 getConceptUri (EntityId $entityId)
 
 getConceptBaseUri (EntityId $entityId)
 

Private Attributes

 $searchHelper
 
 $entitySourceDefinitions
 

Detailed Description

EntitySearchHelper decorator that adds an entity concept URI to the TermSearchResult meta data if not already set.

This works in conjunction with ApiEntitySearchHelper for federated properties that already includes the concept URI in the metadata.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Api\ConceptUriSearchHelper::__construct ( EntitySearchHelper  $searchHelper,
EntitySourceDefinitions  $entitySourceDefinitions 
)

Member Function Documentation

◆ getConceptBaseUri()

Wikibase\Repo\Api\ConceptUriSearchHelper::getConceptBaseUri ( EntityId  $entityId)
private
Parameters
EntityId$entityId
Exceptions
LogicExceptionwhen there is no base URI for the repository $entityId belongs to
Returns
string

◆ getConceptUri()

Wikibase\Repo\Api\ConceptUriSearchHelper::getConceptUri ( EntityId  $entityId)
private
Parameters
EntityId$entityId
Returns
string

◆ getRankedSearchResults()

Wikibase\Repo\Api\ConceptUriSearchHelper::getRankedSearchResults (   $text,
  $languageCode,
  $entityType,
  $limit,
  $strictLanguage 
)

Get entities matching the search term.

Parameters
string$text
string$languageCode
string$entityType
int$limit
bool$strictLanguage
Returns
TermSearchResult[] Key: string Serialized EntityId

Implements Wikibase\Repo\Api\EntitySearchHelper.

Member Data Documentation

◆ $entitySourceDefinitions

Wikibase\Repo\Api\ConceptUriSearchHelper::$entitySourceDefinitions
private

◆ $searchHelper

Wikibase\Repo\Api\ConceptUriSearchHelper::$searchHelper
private

◆ CONCEPTURI_META_DATA_KEY

const Wikibase\Repo\Api\ConceptUriSearchHelper::CONCEPTURI_META_DATA_KEY = TermSearchResult::CONCEPTURI_META_DATA_KEY

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