MediaWiki REL1_35
|
In-memory SiteStore implementation, storing sites in an associative array. More...
Public Member Functions | |
__construct ( $sites=[]) | |
clear () | |
Deletes all sites from the database. | |
getSite ( $globalId, $source='cache') | |
Returns the site with provided global id, or null if there is no such site. | |
getSites ( $source='cache') | |
Returns a list of all sites. | |
saveSite (Site $site) | |
Saves the provided site. | |
saveSites (array $sites) | |
Saves the provided sites. | |
Public Member Functions inherited from SiteLookup | |
getSite ( $globalId) | |
Returns the site with provided global id, or null if there is no such site. | |
getSites () | |
Returns a list of all sites. | |
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 114 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 105 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 $sites, and saveSite().
Referenced by __construct().
|
private |
Definition at line 37 of file HashSiteStore.php.
Referenced by saveSites().