Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\DataAccess\SourceAndTypeDispatchingPrefetchingTermLookup Class Reference
+ Inheritance diagram for Wikibase\DataAccess\SourceAndTypeDispatchingPrefetchingTermLookup:
+ Collaboration diagram for Wikibase\DataAccess\SourceAndTypeDispatchingPrefetchingTermLookup:

Public Member Functions

 __construct (ServiceBySourceAndTypeDispatcher $dispatcher, EntitySourceLookup $sourceLookup)
 
 prefetchTerms (array $entityIds, ?array $termTypes=null, ?array $languageCodes=null)
 
 getPrefetchedTerm (EntityId $entityId, $termType, $languageCode)
 Returns a term that was previously loaded by prefetchTerms.
 
 getPrefetchedAliases (EntityId $entityId, $languageCode)
 Returns terms that were previously loaded by prefetchTerms.
 
- Public Member Functions inherited from Wikibase\Lib\Store\EntityTermLookupBase
 getLabel (EntityId $entityId, $languageCode)
 
 getLabels (EntityId $entityId, array $languageCodes)
 
 getDescription (EntityId $entityId, $languageCode)
 
 getDescriptions (EntityId $entityId, array $languageCodes)
 
- Public Member Functions inherited from Wikibase\DataModel\Services\Term\TermBuffer
 prefetchTerms (array $entityIds, array $termTypes, array $languageCodes)
 Loads a set of terms into the buffer.
 

Protected Member Functions

 getTermsOfType (EntityId $entityId, $termType, array $languageCodes)
 Gets the text string terms for a given type.
 
- Protected Member Functions inherited from Wikibase\Lib\Store\EntityTermLookupBase
 convertTermsToMap (array $wikibaseTerms)
 

Private Member Functions

 groupEntityIdsBySourceAndType (array $entityIds)
 
 getLookupForEntitySourceAndType (EntitySource $source, string $type)
 

Private Attributes

ServiceBySourceAndTypeDispatcher $dispatcher
 
EntitySourceLookup $sourceLookup
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Wikibase\DataAccess\SourceAndTypeDispatchingPrefetchingTermLookup::__construct ( ServiceBySourceAndTypeDispatcher $dispatcher,
EntitySourceLookup $sourceLookup )

Member Function Documentation

◆ getLookupForEntitySourceAndType()

Wikibase\DataAccess\SourceAndTypeDispatchingPrefetchingTermLookup::getLookupForEntitySourceAndType ( EntitySource $source,
string $type )
private

◆ getPrefetchedAliases()

Wikibase\DataAccess\SourceAndTypeDispatchingPrefetchingTermLookup::getPrefetchedAliases ( EntityId $entityId,
$languageCode )

Returns terms that were previously loaded by prefetchTerms.

Parameters
EntityId$entityId
string$languageCode
Returns
string[]|false|null The aliases, or false of that entity has no aliases, or null if the term was not yet requested via prefetchTerms().

Implements Wikibase\DataAccess\AliasTermBuffer.

◆ getPrefetchedTerm()

Wikibase\DataAccess\SourceAndTypeDispatchingPrefetchingTermLookup::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().

Implements Wikibase\DataModel\Services\Term\TermBuffer.

◆ getTermsOfType()

Wikibase\DataAccess\SourceAndTypeDispatchingPrefetchingTermLookup::getTermsOfType ( EntityId $entityId,
$termType,
array $languageCodes )
protected

Gets the text string terms for a given type.

If aliases are requested here you will only receive a single string.

Parameters
EntityId$entityId
string$termType
string[]$languageCodesThe languages to get terms for
Returns
string[] Normally indexed by language code

Reimplemented from Wikibase\Lib\Store\EntityTermLookupBase.

◆ groupEntityIdsBySourceAndType()

Wikibase\DataAccess\SourceAndTypeDispatchingPrefetchingTermLookup::groupEntityIdsBySourceAndType ( array $entityIds)
private

◆ prefetchTerms()

Wikibase\DataAccess\SourceAndTypeDispatchingPrefetchingTermLookup::prefetchTerms ( array $entityIds,
?array $termTypes = null,
?array $languageCodes = null )
Parameters
EntityId[]$entityIds
string[] | null$termTypes
string[] | null$languageCodes

Member Data Documentation

◆ $dispatcher

ServiceBySourceAndTypeDispatcher Wikibase\DataAccess\SourceAndTypeDispatchingPrefetchingTermLookup::$dispatcher
private

◆ $sourceLookup

EntitySourceLookup Wikibase\DataAccess\SourceAndTypeDispatchingPrefetchingTermLookup::$sourceLookup
private

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