Wikibase
MediaWiki Wikibase extension
Wikibase\DataModel\Services\Lookup\TermLookup Interface Reference

A service interface for looking up entity terms. More...

+ Inheritance diagram for Wikibase\DataModel\Services\Lookup\TermLookup:

Public Member Functions

 getLabel (EntityId $entityId, $languageCode)
 Gets the label of an Entity with the specified EntityId and language code. More...
 
 getLabels (EntityId $entityId, array $languageCodes)
 Gets all labels of an Entity with the specified EntityId. More...
 
 getDescription (EntityId $entityId, $languageCode)
 Gets the description of an Entity with the specified EntityId and language code. More...
 
 getDescriptions (EntityId $entityId, array $languageCodes)
 Gets all descriptions of an Entity with the specified EntityId. More...
 

Detailed Description

A service interface for looking up entity terms.

This service only looks up terms in the specified language(s) and does not apply language fallbacks.

Note
: A TermLookup cannot be used to determine whether an entity exists or not.
Since
1.1
Author
Katie Filbert < aude..nosp@m.wiki.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >

Member Function Documentation

◆ getDescription()

Wikibase\DataModel\Services\Lookup\TermLookup::getDescription ( EntityId  $entityId,
  $languageCode 
)

◆ getDescriptions()

Wikibase\DataModel\Services\Lookup\TermLookup::getDescriptions ( EntityId  $entityId,
array  $languageCodes 
)

Gets all descriptions of an Entity with the specified EntityId.

If $languages is given, the result will contain the entries for the requested languages, if they exist.

Since
2.0
Parameters
EntityId$entityId
string[]$languageCodesThe list of languages to fetch
Exceptions
TermLookupExceptionif the entity was not found (not guaranteed).
Returns
string[] descriptions, keyed by language.

Implemented in Wikibase\DataModel\Services\Lookup\EntityRetrievingTermLookup, Wikibase\Lib\Store\EntityTermLookupBase, Wikibase\Lib\Store\CachingPrefetchingTermLookup, Wikibase\DataAccess\NullPrefetchingTermLookup, and Wikibase\Client\DataAccess\Scribunto\CachingFallbackBasedTermLookup.

◆ getLabel()

Wikibase\DataModel\Services\Lookup\TermLookup::getLabel ( EntityId  $entityId,
  $languageCode 
)

◆ getLabels()

Wikibase\DataModel\Services\Lookup\TermLookup::getLabels ( EntityId  $entityId,
array  $languageCodes 
)

Gets all labels of an Entity with the specified EntityId.

The result will contain the entries for the requested languages, if they exist.

Since
2.0
Parameters
EntityId$entityId
string[]$languageCodesThe list of languages to fetch
Exceptions
TermLookupExceptionif the entity was not found (not guaranteed).
Returns
string[] labels, keyed by language.

Implemented in Wikibase\DataModel\Services\Lookup\EntityRetrievingTermLookup, Wikibase\Lib\Store\EntityTermLookupBase, Wikibase\Lib\Store\CachingPrefetchingTermLookup, Wikibase\DataAccess\NullPrefetchingTermLookup, and Wikibase\Client\DataAccess\Scribunto\CachingFallbackBasedTermLookup.


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