36 private $cacheKey =
null;
38 private $sites =
null;
48 $this->siteStore = $siteStore;
49 $this->cache = $cache;
66 private function getCacheKey() {
67 if ( $this->cacheKey ===
null ) {
69 $this->cacheKey = $this->cache->makeKey(
'site-SiteList', $version );
72 return $this->cacheKey;
82 if ( $this->sites ===
null ) {
83 $this->sites = $this->cache->getWithSetCallback(
87 return $this->siteStore->getSites();
105 return $sites->
hasSite( $globalId ) ? $sites->
getSite( $globalId ) :
null;
131 $success = $this->siteStore->saveSites( $sites );
146 $this->cache->delete( $this->getCacheKey() );
163 return $this->siteStore->clear();
Class representing a cache/ephemeral data store.
Hold a configured list of sites (SiteList), with a caching layer.
__construct(SiteStore $siteStore, BagOStuff $cache)
clear()
Clears the list of sites stored.
reset()
Purge the internal and external cache of the site list, forcing the list.
static getSerialVersionId()
Returns the version ID that identifies the serialization structure used by __serialize() and unserial...
hasSite( $globalSiteId)
Returns if the list contains the site with the provided global site identifier.
getSite( $globalSiteId)
Returns the Site with the provided global site identifier.
Represents a single site.
Interface for storing and retrieving Site objects.