Factory to provide an LabelDescriptionLookup which does automatic prefetching of terms, applies a language fallback and returns the LabelDescriptionLookup.
More...
Factory to provide an LabelDescriptionLookup which does automatic prefetching of terms, applies a language fallback and returns the LabelDescriptionLookup.
- Copyright
- GPL-2.0-or-later
- Author
- Bene* < benes.nosp@m.tar..nosp@m.wikim.nosp@m.edia.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >
◆ __construct()
- Parameters
-
| LanguageFallbackChainFactory | $languageFallbackChainFactory | |
| TermLookup | $termLookup | |
| TermBuffer | null | $termBuffer | |
| int | $fallbackMode | Either 0 or a combination of the LanguageFallbackChainFactory::FALLBACK_... constants. |
- Exceptions
-
◆ newLabelDescriptionLookup()
| Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookupFactory::newLabelDescriptionLookup |
( |
Language |
$language, |
|
|
array |
$entityIds = [], |
|
|
array |
$termTypes = [ 'label' ] |
|
) |
| |
Returns a LabelDescriptionLookup where terms are prefetched for the given entity ids with a language fallback chain applied for the given language.
- Parameters
-
| Language | $language | |
| EntityId[] | $entityIds | Array of entity ids that should be prefetched. Only relevant when a TermBuffer was set in the constructor. Default is no prefetching. |
| string[] | $termTypes | Array with one or more of the types 'label', 'alias' and 'description'. Default is only 'label'. |
- Returns
- LanguageFallbackLabelDescriptionLookup
◆ $fallbackMode
| Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookupFactory::$fallbackMode |
|
private |
◆ $languageFallbackChainFactory
| Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookupFactory::$languageFallbackChainFactory |
|
private |
◆ $termBuffer
| Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookupFactory::$termBuffer |
|
private |
◆ $termLookup
| Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookupFactory::$termLookup |
|
private |
The documentation for this class was generated from the following file: