Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Lib\Interactors\TermSearchResult Class Reference

Public Member Functions

 __construct (Term $matchedTerm, string $matchedTermType, ?EntityId $entityId, ?Term $displayLabel=null, ?Term $displayDescription=null, array $metaData=[])
 
 getMatchedTerm ()
 
 getMatchedTermType ()
 
 getEntityId ()
 The entity ID of the search result.
 
 getDisplayLabel ()
 
 getDisplayDescription ()
 
 getMetaData ()
 
 getEntityIdSerialization ()
 Return the serialization of the entity ID of the search result, either from self::getEntityId() or self::getMetaData().
 

Public Attributes

const CONCEPTURI_META_DATA_KEY = 'concepturi'
 

Private Attributes

 $matchedTerm
 
 $matchedTermType
 
 $entityId
 
 $displayLabel
 
 $displayDescription
 
 $metaData
 

Detailed Description

Author
Addshore

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Interactors\TermSearchResult::__construct ( Term $matchedTerm,
string $matchedTermType,
?EntityId $entityId,
?Term $displayLabel = null,
?Term $displayDescription = null,
array $metaData = [] )
Parameters
Term$matchedTerm
string$matchedTermType
EntityId | null$entityId
Term | null$displayLabel
Term | null$displayDescription

Member Function Documentation

◆ getDisplayDescription()

Wikibase\Lib\Interactors\TermSearchResult::getDisplayDescription ( )
Returns
Term|null

◆ getDisplayLabel()

Wikibase\Lib\Interactors\TermSearchResult::getDisplayLabel ( )
Returns
Term|null

◆ getEntityId()

Wikibase\Lib\Interactors\TermSearchResult::getEntityId ( )

The entity ID of the search result.

This should usually be an EntityId; to support search for additional entity types that are not registered with Wikibase’s entity registration yet, it may temporarily be null. In that case, the meta data must include the entity ID serialization and additional data which would usually be added automatically based on the entity ID (i.e., id, title, pageid, url, concepturi).

Returns
EntityId|null

◆ getEntityIdSerialization()

Wikibase\Lib\Interactors\TermSearchResult::getEntityIdSerialization ( )

Return the serialization of the entity ID of the search result, either from self::getEntityId() or self::getMetaData().

◆ getMatchedTerm()

Wikibase\Lib\Interactors\TermSearchResult::getMatchedTerm ( )
Returns
Term

◆ getMatchedTermType()

Wikibase\Lib\Interactors\TermSearchResult::getMatchedTermType ( )
Returns
string

◆ getMetaData()

Wikibase\Lib\Interactors\TermSearchResult::getMetaData ( )
Returns
array [ key => value ] map of meta data about the returned search result or its associated entity

Member Data Documentation

◆ $displayDescription

Wikibase\Lib\Interactors\TermSearchResult::$displayDescription
private

◆ $displayLabel

Wikibase\Lib\Interactors\TermSearchResult::$displayLabel
private

◆ $entityId

Wikibase\Lib\Interactors\TermSearchResult::$entityId
private

◆ $matchedTerm

Wikibase\Lib\Interactors\TermSearchResult::$matchedTerm
private

◆ $matchedTermType

Wikibase\Lib\Interactors\TermSearchResult::$matchedTermType
private

◆ $metaData

Wikibase\Lib\Interactors\TermSearchResult::$metaData
private

◆ CONCEPTURI_META_DATA_KEY

const Wikibase\Lib\Interactors\TermSearchResult::CONCEPTURI_META_DATA_KEY = 'concepturi'

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