Wikibase
MediaWiki Wikibase extension
Wikibase\DataAccess\NullPrefetchingTermLookup Class Reference

PrefetchingTermLookup implementation that does nothing. More...

+ Inheritance diagram for Wikibase\DataAccess\NullPrefetchingTermLookup:
+ Collaboration diagram for Wikibase\DataAccess\NullPrefetchingTermLookup:

Public Member Functions

 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.
More...
 
 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().
More...
 
 getLabel (EntityId $entityId, $languageCode)
 Gets the label of an Entity with the specified EntityId and language code.
Since
2.0
Parameters
EntityId$entityId
string$languageCode
Exceptions
TermLookupExceptionfor entity not found
Returns
string|null
More...
 
 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.
More...
 
 getDescription (EntityId $entityId, $languageCode)
 Gets the description of an Entity with the specified EntityId and language code.
Since
2.0
Parameters
EntityId$entityId
string$languageCode
Exceptions
TermLookupExceptionfor entity not found
Returns
string|null
More...
 
 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.
More...
 
 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().
More...
 

Detailed Description

PrefetchingTermLookup implementation that does nothing.

Intended to be used with some services that require a default PrefetchingTermLookup in situations that a default does not make sense.

Author
Addshore

Member Function Documentation

◆ getDescription()

Wikibase\DataAccess\NullPrefetchingTermLookup::getDescription ( EntityId  $entityId,
  $languageCode 
)

Gets the description of an Entity with the specified EntityId and language code.

Since
2.0
Parameters
EntityId$entityId
string$languageCode
Exceptions
TermLookupExceptionfor entity not found
Returns
string|null

Implements Wikibase\DataModel\Services\Lookup\TermLookup.

◆ getDescriptions()

Wikibase\DataAccess\NullPrefetchingTermLookup::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.

Implements Wikibase\DataModel\Services\Lookup\TermLookup.

◆ getLabel()

Wikibase\DataAccess\NullPrefetchingTermLookup::getLabel ( EntityId  $entityId,
  $languageCode 
)

Gets the label of an Entity with the specified EntityId and language code.

Since
2.0
Parameters
EntityId$entityId
string$languageCode
Exceptions
TermLookupExceptionfor entity not found
Returns
string|null

Implements Wikibase\DataModel\Services\Lookup\TermLookup.

◆ getLabels()

Wikibase\DataAccess\NullPrefetchingTermLookup::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.

Implements Wikibase\DataModel\Services\Lookup\TermLookup.

◆ getPrefetchedAliases()

Wikibase\DataAccess\NullPrefetchingTermLookup::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\NullPrefetchingTermLookup::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.

◆ prefetchTerms()

Wikibase\DataAccess\NullPrefetchingTermLookup::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.

Implements Wikibase\DataModel\Services\Term\TermBuffer.


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