Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\DataModel\Services\Term\TermBuffer Interface Reference

A service interface for buffering terms. More...

+ Inheritance diagram for Wikibase\DataModel\Services\Term\TermBuffer:

Public Member Functions

 prefetchTerms (array $entityIds, array $termTypes, array $languageCodes)
 Loads a set of terms into the buffer.
 
 getPrefetchedTerm (EntityId $entityId, $termType, $languageCode)
 Returns a term that was previously loaded by prefetchTerms.
 

Detailed Description

A service interface for buffering terms.

Typically implemented in conjunction with TermLookup, and (like that interface) does not apply language fallbacks.

Since
1.1
Author
Daniel Kinzler

Member Function Documentation

◆ getPrefetchedTerm()

Wikibase\DataModel\Services\Term\TermBuffer::getPrefetchedTerm ( EntityId $entityId,
$termType,
$languageCode )

Returns a term that was previously loaded by prefetchTerms.

Parameters
EntityId$entityId
string$termTypeOne of of TermTypes::TYPE_LABEL, TermTypes::TYPE_DESCRIPTION, TermTypes::TYPE_ALIAS
string$languageCode
Returns
string|false|null The term, or false of that term is known to not exist, or null if the term was not yet requested via prefetchTerms().

Implemented in Wikibase\DataAccess\NullPrefetchingTermLookup, Wikibase\DataAccess\SourceAndTypeDispatchingPrefetchingTermLookup, Wikibase\Lib\Store\CachingPrefetchingTermLookup, Wikibase\Lib\Store\Sql\Terms\PrefetchingEntityTermLookupBase, and Wikibase\Repo\FederatedProperties\ApiPrefetchingTermLookup.

◆ prefetchTerms()

Wikibase\DataModel\Services\Term\TermBuffer::prefetchTerms ( array $entityIds,
array $termTypes,
array $languageCodes )

Loads a set of terms into the buffer.

The source from which to fetch would typically be supplied to the buffer's constructor.

Parameters
EntityId[]$entityIds
string[]$termTypesThe desired term types, i.e. any of TermTypes::TYPE_LABEL, TermTypes::TYPE_DESCRIPTION, TermTypes::TYPE_ALIAS
string[]$languageCodesThe desired languages.

Implemented in Wikibase\DataAccess\NullPrefetchingTermLookup, Wikibase\DataAccess\SourceAndTypeDispatchingPrefetchingTermLookup, Wikibase\Lib\Store\CachingPrefetchingTermLookup, and Wikibase\Repo\FederatedProperties\ApiPrefetchingTermLookup.


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