Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Lib\Store\CachingPropertyInfoLookup Class Reference

Class CachingPropertyInfoLookup is an implementation of PropertyInfoLookup that maintains a cached copy of the property info. More...

+ Inheritance diagram for Wikibase\Lib\Store\CachingPropertyInfoLookup:
+ Collaboration diagram for Wikibase\Lib\Store\CachingPropertyInfoLookup:

Public Member Functions

 __construct (PropertyInfoLookup $lookup, $cache, $cacheKeyGroup, $cacheDuration=3600)
 
 getPropertyInfo (PropertyId $propertyId)
 
 getPropertyInfoForDataType ( $dataType)
 
 getAllPropertyInfo ()
 

Public Attributes

const SINGLE_PROPERTY_CACHE_KEY_SEPARATOR = ':'
 
- Public Attributes inherited from Wikibase\Lib\Store\PropertyInfoLookup
const KEY_DATA_TYPE = 'type'
 Key to use in the info array for the property's data type ID.
 
const KEY_FORMATTER_URL = 'formatterURL'
 Key to use in the info array for the property's formatter URL.
 

Protected Attributes

 $lookup
 
 $cache
 
 $cacheDuration
 
 $cacheKeyGroup
 
 $propertyInfo = []
 
 $propertyInfoFullyPopulated = false
 

Private Member Functions

 getPropertyInfoFromCache (PropertyId $propertyId)
 
 getFullTableCacheKey ()
 
 getSinglePropertyCacheKey (PropertyId $propertyId)
 

Private Attributes

 $logger
 

Detailed Description

Class CachingPropertyInfoLookup is an implementation of PropertyInfoLookup that maintains a cached copy of the property info.

Note: Cache keys used by this class should be in sync with keys used by CacheAwarePropertyInfoStore instance.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Store\CachingPropertyInfoLookup::__construct ( PropertyInfoLookup  $lookup,
  $cache,
  $cacheKeyGroup,
  $cacheDuration = 3600 
)
Parameters
PropertyInfoLookup$lookupThe info lookup to call back to.
BagOStuff | WANObjectCache$cache
string$cacheKeyGroupGroup name of the Wikibases to be used when generating global cache keys
int$cacheDurationNumber of seconds to keep the cached version for. Defaults to 3600 seconds = 1 hour.

Member Function Documentation

◆ getAllPropertyInfo()

Wikibase\Lib\Store\CachingPropertyInfoLookup::getAllPropertyInfo ( )
See also
PropertyInfoLookup::getAllPropertyInfo
Returns
array[] Array containing serialized property IDs as keys and info arrays as values

Implements Wikibase\Lib\Store\PropertyInfoLookup.

◆ getFullTableCacheKey()

Wikibase\Lib\Store\CachingPropertyInfoLookup::getFullTableCacheKey ( )
private

◆ getPropertyInfo()

Wikibase\Lib\Store\CachingPropertyInfoLookup::getPropertyInfo ( PropertyId  $propertyId)
See also
PropertyInfoLookup::getPropertyInfo
Parameters
PropertyId$propertyId
Returns
array|null

Implements Wikibase\Lib\Store\PropertyInfoLookup.

◆ getPropertyInfoForDataType()

Wikibase\Lib\Store\CachingPropertyInfoLookup::getPropertyInfoForDataType (   $dataType)
See also
PropertyInfoLookup::getPropertyInfoForDataType
Parameters
string$dataType
Returns
array[] Array containing serialized property IDs as keys and info arrays as values

Implements Wikibase\Lib\Store\PropertyInfoLookup.

◆ getPropertyInfoFromCache()

Wikibase\Lib\Store\CachingPropertyInfoLookup::getPropertyInfoFromCache ( PropertyId  $propertyId)
private
Parameters
PropertyId$propertyId
Returns
array|null

◆ getSinglePropertyCacheKey()

Wikibase\Lib\Store\CachingPropertyInfoLookup::getSinglePropertyCacheKey ( PropertyId  $propertyId)
private

Member Data Documentation

◆ $cache

Wikibase\Lib\Store\CachingPropertyInfoLookup::$cache
protected

◆ $cacheDuration

Wikibase\Lib\Store\CachingPropertyInfoLookup::$cacheDuration
protected

◆ $cacheKeyGroup

Wikibase\Lib\Store\CachingPropertyInfoLookup::$cacheKeyGroup
protected

◆ $logger

Wikibase\Lib\Store\CachingPropertyInfoLookup::$logger
private

◆ $lookup

Wikibase\Lib\Store\CachingPropertyInfoLookup::$lookup
protected

◆ $propertyInfo

Wikibase\Lib\Store\CachingPropertyInfoLookup::$propertyInfo = []
protected

◆ $propertyInfoFullyPopulated

Wikibase\Lib\Store\CachingPropertyInfoLookup::$propertyInfoFullyPopulated = false
protected

◆ SINGLE_PROPERTY_CACHE_KEY_SEPARATOR

const Wikibase\Lib\Store\CachingPropertyInfoLookup::SINGLE_PROPERTY_CACHE_KEY_SEPARATOR = ':'

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