Wikibase
MediaWiki Wikibase extension
|
This TermLookup allows exposes language based lookups for getLabel and getDescription and is backed by the shared TermFallbackCache which stores TermFallback objects. More...
Public Member Functions | |
__construct (TermFallbackCacheFacade $termFallbackCacheFacade, RedirectResolvingLatestRevisionLookup $redirectResolvingLatestRevisionLookup, LanguageFallbackChainFactory $languageFallbackChainFactory, TermLookup $termLookup, LanguageFactory $languageFactory, LanguageNameUtils $langNameUtils, ContentLanguages $contentLanguages) | |
getLabel (EntityId $entityId, $languageCode) | |
Gets the label of an Entity with the specified EntityId and language code. | |
getDescription (EntityId $entityId, $languageCode) | |
Gets the description of an Entity with the specified EntityId and language code. | |
getLabels (EntityId $entityId, array $languageCodes) | |
Gets all labels of an Entity with the specified EntityId. | |
getDescriptions (EntityId $entityId, array $languageCodes) | |
Gets all descriptions of an Entity with the specified EntityId. | |
Private Member Functions | |
getTerm (EntityId $entityId, string $languageCode, string $termType) | |
getLookup (Language $language) | |
lookupWithoutCache (EntityId $entityId, Language $language, $termType) | |
Private Attributes | |
$termFallbackCache | |
$redirectResolvingLatestRevisionLookup | |
$languageFallbackChainFactory | |
$termLookup | |
$languageFactory | |
$langNameUtils | |
$contentLanguages | |
$lookups | |
This TermLookup allows exposes language based lookups for getLabel and getDescription and is backed by the shared TermFallbackCache which stores TermFallback objects.
The lookup tries to find the term in the cache and if not present builds a LanguageFallbackLabelDescriptionLookup based on the TermFallbackChain generated by the requested Language.
If the requested language does not match the actual language of the TermFallback this value will still be written to the cache but not returned.
If the TermFallback returns null this value will also be written to the cache as this means no term is available in the requested language.
Wikibase\Client\DataAccess\Scribunto\CachingFallbackBasedTermLookup::__construct | ( | TermFallbackCacheFacade | $termFallbackCacheFacade, |
RedirectResolvingLatestRevisionLookup | $redirectResolvingLatestRevisionLookup, | ||
LanguageFallbackChainFactory | $languageFallbackChainFactory, | ||
TermLookup | $termLookup, | ||
LanguageFactory | $languageFactory, | ||
LanguageNameUtils | $langNameUtils, | ||
ContentLanguages | $contentLanguages ) |
Wikibase\Client\DataAccess\Scribunto\CachingFallbackBasedTermLookup::getDescription | ( | EntityId | $entityId, |
$languageCode ) |
Gets the description of an Entity with the specified EntityId and language code.
EntityId | $entityId | |
string | $languageCode |
TermLookupException | for entity not found |
Implements Wikibase\DataModel\Services\Lookup\TermLookup.
Wikibase\Client\DataAccess\Scribunto\CachingFallbackBasedTermLookup::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.
EntityId | $entityId | |
string[] | $languageCodes | The list of languages to fetch |
TermLookupException | if the entity was not found (not guaranteed). |
Implements Wikibase\DataModel\Services\Lookup\TermLookup.
Wikibase\Client\DataAccess\Scribunto\CachingFallbackBasedTermLookup::getLabel | ( | EntityId | $entityId, |
$languageCode ) |
Gets the label of an Entity with the specified EntityId and language code.
EntityId | $entityId | |
string | $languageCode |
TermLookupException | for entity not found |
Implements Wikibase\DataModel\Services\Lookup\TermLookup.
Wikibase\Client\DataAccess\Scribunto\CachingFallbackBasedTermLookup::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.
EntityId | $entityId | |
string[] | $languageCodes | The list of languages to fetch |
TermLookupException | if the entity was not found (not guaranteed). |
Implements Wikibase\DataModel\Services\Lookup\TermLookup.
|
private |
|
private |
|
private |
EntityId | $entityId | |
Language | $language | |
string | $termType |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |