A PrefetchingTermLookup
for federated properties.
More...
A PrefetchingTermLookup
for federated properties.
Prefetches from GenericActionApiClient(API) and stores them in $terms (current process only). Looks up terms from $terms.
- Copyright
- GPL-2.0-or-later
◆ __construct()
Wikibase\Repo\FederatedProperties\ApiPrefetchingTermLookup::__construct |
( |
ApiEntityLookup |
$apiEntityLookup | ) |
|
- Parameters
-
ApiEntityLookup | $apiEntityLookup | |
◆ getKey()
Wikibase\Repo\FederatedProperties\ApiPrefetchingTermLookup::getKey |
( |
EntityId |
$entityId, |
|
|
string |
$termType, |
|
|
string |
$languageCode |
|
) |
| |
|
private |
◆ getKeyString()
Wikibase\Repo\FederatedProperties\ApiPrefetchingTermLookup::getKeyString |
( |
string |
$entityId, |
|
|
string |
$termType, |
|
|
string |
$languageCode |
|
) |
| |
|
private |
◆ getPrefetchedAliases()
Wikibase\Repo\FederatedProperties\ApiPrefetchingTermLookup::getPrefetchedAliases |
( |
EntityId |
$entityId, |
|
|
|
$languageCode |
|
) |
| |
◆ getPrefetchedTerm()
Wikibase\Repo\FederatedProperties\ApiPrefetchingTermLookup::getPrefetchedTerm |
( |
EntityId |
$entityId, |
|
|
|
$termType, |
|
|
|
$languageCode |
|
) |
| |
Returns a term that was previously loaded by prefetchTerms.
- Parameters
-
EntityId | $entityId | |
string | $termType | |
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().
◆ getTermsOfType()
Wikibase\Repo\FederatedProperties\ApiPrefetchingTermLookup::getTermsOfType |
( |
EntityId |
$entityId, |
|
|
|
$termType, |
|
|
array |
$languageCodes |
|
) |
| |
|
protected |
◆ isPrefetched()
Wikibase\Repo\FederatedProperties\ApiPrefetchingTermLookup::isPrefetched |
( |
EntityId |
$entityId, |
|
|
array |
$termTypes, |
|
|
array |
$languageCodes |
|
) |
| |
|
private |
◆ prefetchTerms()
Wikibase\Repo\FederatedProperties\ApiPrefetchingTermLookup::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[] | $termTypes | The desired term types. |
string[] | $languageCodes | The desired languages. |
- Exceptions
-
BadMethodCallException | if $termTypes is anything other than [ 'label' ] |
◆ setKeys()
Wikibase\Repo\FederatedProperties\ApiPrefetchingTermLookup::setKeys |
( |
array |
$entityIds, |
|
|
array |
$termTypes, |
|
|
array |
$languageCodes |
|
) |
| |
|
private |
◆ translateTermTypesToApiProps()
Wikibase\Repo\FederatedProperties\ApiPrefetchingTermLookup::translateTermTypesToApiProps |
( |
array |
$termTypes | ) |
|
|
private |
◆ validateTermTypes()
Wikibase\Repo\FederatedProperties\ApiPrefetchingTermLookup::validateTermTypes |
( |
array |
$termTypes | ) |
|
|
private |
◆ $apiEntityLookup
Wikibase\Repo\FederatedProperties\ApiPrefetchingTermLookup::$apiEntityLookup |
|
private |
◆ $termKeys
Wikibase\Repo\FederatedProperties\ApiPrefetchingTermLookup::$termKeys = [] |
|
private |
◆ $terms
Wikibase\Repo\FederatedProperties\ApiPrefetchingTermLookup::$terms = [] |
|
private |
◆ SUPPORTED_TERM_TYPES
const Wikibase\Repo\FederatedProperties\ApiPrefetchingTermLookup::SUPPORTED_TERM_TYPES = [ TermTypes::TYPE_LABEL, TermTypes::TYPE_DESCRIPTION ] |
|
private |
The documentation for this class was generated from the following file: