MediaWiki
1.28.0
|
In-memory SiteStore implementation, storing sites in an associative array. More...
Public Member Functions | |
__construct ($sites=[]) | |
clear () | |
Deletes all sites from the database. More... | |
getSite ($globalId, $source= 'cache') | |
Returns the site with provided global id, or null if there is no such site. More... | |
getSites ($source= 'cache') | |
Returns a list of all sites. More... | |
saveSite (Site $site) | |
Saves the provided site. More... | |
saveSites (array $sites) | |
Saves the provided sites. More... | |
Public Member Functions inherited from SiteLookup | |
getSite ($globalId) | |
Returns the site with provided global id, or null if there is no such site. More... | |
getSites () | |
Returns a list of all sites. More... | |
Private Attributes | |
Site[] | $sites = [] |
In-memory SiteStore implementation, storing sites in an associative array.
Definition at line 32 of file HashSiteStore.php.
HashSiteStore::__construct | ( | $sites = [] | ) |
HashSiteStore::clear | ( | ) |
Deletes all sites from the database.
After calling clear(), getSites() will return an empty list and getSite() will return null until saveSite() or saveSites() is called.
Implements SiteStore.
Definition at line 117 of file HashSiteStore.php.
HashSiteStore::getSite | ( | $globalId, | |
$source = 'cache' |
|||
) |
Returns the site with provided global id, or null if there is no such site.
string | $globalId | |
string | $source | either 'cache' or 'recache'. If 'cache', the values can (but not obliged) come from a cache. |
Definition at line 89 of file HashSiteStore.php.
HashSiteStore::getSites | ( | $source = 'cache' | ) |
Returns a list of all sites.
By default this site is fetched from the cache, which can be changed to loading the list from the database using the $useCache parameter.
string | $source | either 'cache' or 'recache'. If 'cache', the values can (but not obliged) come from a cache. |
Definition at line 109 of file HashSiteStore.php.
HashSiteStore::saveSite | ( | Site | $site | ) |
Saves the provided site.
Site | $site |
Implements SiteStore.
Definition at line 55 of file HashSiteStore.php.
References Site\getGlobalId().
Referenced by saveSites().
HashSiteStore::saveSites | ( | array | $sites | ) |
Saves the provided sites.
Site[] | $sites |
Implements SiteStore.
Definition at line 70 of file HashSiteStore.php.
References as, and saveSite().
Referenced by __construct().
|
private |
Definition at line 37 of file HashSiteStore.php.