Wikibase
MediaWiki Wikibase extension
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. More...
 
 getPrefetchedTerm (EntityId $entityId, $termType, $languageCode)
 Returns a term that was previously loaded by prefetchTerms. More...
 

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\Repo\FederatedProperties\ApiPrefetchingTermLookup, Wikibase\Lib\Store\Sql\Terms\PrefetchingEntityTermLookupBase, Wikibase\Lib\Store\CachingPrefetchingTermLookup, Wikibase\DataAccess\SourceAndTypeDispatchingPrefetchingTermLookup, and Wikibase\DataAccess\NullPrefetchingTermLookup.

◆ 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\SourceAndTypeDispatchingPrefetchingTermLookup, Wikibase\Repo\FederatedProperties\ApiPrefetchingTermLookup, Wikibase\Lib\Store\CachingPrefetchingTermLookup, and Wikibase\DataAccess\NullPrefetchingTermLookup.


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