Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Lib\Store\Sql\Terms\CachedDatabasePropertyLabelResolver Class Reference

Resolves and caches property labels (which are unique per language) into entity IDs through DatabaseTermIdsResolver api. More...

+ Inheritance diagram for Wikibase\Lib\Store\Sql\Terms\CachedDatabasePropertyLabelResolver:
+ Collaboration diagram for Wikibase\Lib\Store\Sql\Terms\CachedDatabasePropertyLabelResolver:

Public Member Functions

 __construct ( $languageCode, TermInLangIdsResolver $dbTermInLangIdsResolver, BagOStuff $cache, $cacheDuration, $cacheKey)
 
- Public Member Functions inherited from Wikibase\Lib\Store\AbstractTermPropertyLabelResolver
 __construct ( $languageCode, BagOStuff $cache, $cacheDuration, $cacheKey)
 
 getPropertyIdsForLabels (array $labels, $recache='')
 

Protected Member Functions

 loadProperties ()
 
- Protected Member Functions inherited from Wikibase\Lib\Store\AbstractTermPropertyLabelResolver
 getLabelMap ( $recache='')
 Returns a map of labels to EntityIds for all Properties currently defined.
 
 getCachedLabelMap ( $recache)
 
 needsRecache (array $propertyIds)
 Checks if recache is needed.
 

Private Attributes

 $dbTermInLangIdsResolver
 

Additional Inherited Members

- Protected Attributes inherited from Wikibase\Lib\Store\AbstractTermPropertyLabelResolver
 $languageCode
 

Detailed Description

Resolves and caches property labels (which are unique per language) into entity IDs through DatabaseTermIdsResolver api.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Store\Sql\Terms\CachedDatabasePropertyLabelResolver::__construct ( $languageCode,
TermInLangIdsResolver $dbTermInLangIdsResolver,
BagOStuff $cache,
$cacheDuration,
$cacheKey )
Parameters
string$languageCodeThe language of the labels to look up (typically, the wiki's content language)
TermInLangIdsResolver$dbTermInLangIdsResolverMust be instance of DatabaseTermInLangIdsResolver
BagOStuff$cacheThe cache to use for labels
int$cacheDurationNumber of seconds to keep the cached version for. Defaults to 3600 seconds = 1 hour.
string$cacheKeyThe cache key to use, auto-generated based on $lang per default. Should be set to something including the wiki name of the wiki that maintains the properties.

Member Function Documentation

◆ loadProperties()

Wikibase\Lib\Store\Sql\Terms\CachedDatabasePropertyLabelResolver::loadProperties ( )
protected
Returns
EntityId[] Map of labels to EntityIds

Reimplemented from Wikibase\Lib\Store\AbstractTermPropertyLabelResolver.

Member Data Documentation

◆ $dbTermInLangIdsResolver

Wikibase\Lib\Store\Sql\Terms\CachedDatabasePropertyLabelResolver::$dbTermInLangIdsResolver
private

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