Wikibase
MediaWiki Wikibase extension
Wikibase\Lib\Store\CacheAwarePropertyInfoStore Class Reference

Implementation of PropertyInfoStore wrapping the instance modifying the local PropertyInfoStore and adjusting the property info cache accordingly. More...

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

Public Member Functions

 __construct (PropertyInfoStore $store, WANObjectCache $cache, $cacheDuration=3600, $cacheKeyGroup='')
 
 setPropertyInfo (PropertyId $propertyId, array $info)
 
 removePropertyInfo (PropertyId $propertyId)
 

Public Attributes

const CACHE_CLASS = 'CacheAwarePropertyInfoStore'
 
- Public Attributes inherited from Wikibase\Lib\Store\PropertyInfoStore
const KEY_CANONICAL_URI = 'canonicalURI'
 Key to use in the info array for the property's canonical URI pattern. More...
 

Protected Attributes

 $innerStore
 
 $cache
 
 $cacheDuration
 
 $cacheKeyGroup
 

Private Member Functions

 getFullTableCacheKey ()
 
 getSinglePropertyCacheKey (PropertyId $propertyId)
 
 deleteFullTableCacheKey ()
 
 deleteCacheKeyForProperty (PropertyId $propertyId)
 

Private Attributes

const SINGLE_PROPERTY_CACHE_KEY_SEPARATOR = ':'
 
 $logger
 

Detailed Description

Implementation of PropertyInfoStore wrapping the instance modifying the local PropertyInfoStore and adjusting the property info cache accordingly.

Note: In-process cache (e.g. held by CachingPropertyInfoLookup instances) is NOT updated when changes are done by the store. Note: Cache keys used by this class should be in sync with keys used by CachingPropertyInfoLookup instances.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ deleteCacheKeyForProperty()

Wikibase\Lib\Store\CacheAwarePropertyInfoStore::deleteCacheKeyForProperty ( PropertyId  $propertyId)
private

◆ deleteFullTableCacheKey()

Wikibase\Lib\Store\CacheAwarePropertyInfoStore::deleteFullTableCacheKey ( )
private

◆ getFullTableCacheKey()

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

◆ getSinglePropertyCacheKey()

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

◆ removePropertyInfo()

Wikibase\Lib\Store\CacheAwarePropertyInfoStore::removePropertyInfo ( PropertyId  $propertyId)
See also
PropertyInfoStore::removePropertyInfo
Parameters
PropertyId$propertyId
Returns
bool

Implements Wikibase\Lib\Store\PropertyInfoStore.

◆ setPropertyInfo()

Wikibase\Lib\Store\CacheAwarePropertyInfoStore::setPropertyInfo ( PropertyId  $propertyId,
array  $info 
)
See also
PropertyInfoStore::setPropertyInfo
Parameters
PropertyId$propertyId
array$info
Exceptions
InvalidArgumentException

Implements Wikibase\Lib\Store\PropertyInfoStore.

Member Data Documentation

◆ $cache

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

◆ $cacheDuration

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

◆ $cacheKeyGroup

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

◆ $innerStore

Wikibase\Lib\Store\CacheAwarePropertyInfoStore::$innerStore
protected

◆ $logger

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

◆ CACHE_CLASS

const Wikibase\Lib\Store\CacheAwarePropertyInfoStore::CACHE_CLASS = 'CacheAwarePropertyInfoStore'

◆ SINGLE_PROPERTY_CACHE_KEY_SEPARATOR

const Wikibase\Lib\Store\CacheAwarePropertyInfoStore::SINGLE_PROPERTY_CACHE_KEY_SEPARATOR = ':'
private

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