|
MediaWiki master
|
In-memory SiteStore implementation, stored in an associative array. More...
Inherits MediaWiki\Site\SiteStore.

Public Member Functions | |
| __construct (array $sites=[]) | |
| clear () | |
| Delete all sites from the database. | |
| getSite ( $globalId, $source='cache') | |
| Return the site with provided global ID, or null if there is no such site. | |
| getSites ( $source='cache') | |
| Return a list of all sites. | |
| saveSite (Site $site) | |
| Save the provided site. | |
| saveSites (array $sites) | |
| Save the provided sites. | |
Public Member Functions inherited from MediaWiki\Site\SiteLookup | |
| getSite ( $globalId) | |
| Return the site with provided global ID, or null if there is no such site. | |
| getSites () | |
| Return a list of all sites. | |
In-memory SiteStore implementation, stored in an associative array.
Definition at line 17 of file HashSiteStore.php.
| MediaWiki\Site\HashSiteStore::__construct | ( | array | $sites = [] | ) |
| Site[] | $sites |
Definition at line 24 of file HashSiteStore.php.
References MediaWiki\Site\HashSiteStore\saveSites().
| MediaWiki\Site\HashSiteStore::clear | ( | ) |
Delete 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 MediaWiki\Site\SiteStore.
Definition at line 92 of file HashSiteStore.php.
| MediaWiki\Site\HashSiteStore::getSite | ( | $globalId, | |
| $source = 'cache' ) |
Return 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 65 of file HashSiteStore.php.
| MediaWiki\Site\HashSiteStore::getSites | ( | $source = 'cache' | ) |
Return a list of all sites.
By default this list 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 80 of file HashSiteStore.php.
| MediaWiki\Site\HashSiteStore::saveSite | ( | Site | $site | ) |
Save the provided site.
| Site | $site |
Implements MediaWiki\Site\SiteStore.
Definition at line 35 of file HashSiteStore.php.
References MediaWiki\Site\Site\getGlobalId().
Referenced by MediaWiki\Site\HashSiteStore\saveSites().
| MediaWiki\Site\HashSiteStore::saveSites | ( | array | $sites | ) |
Save the provided sites.
| Site[] | $sites |
Implements MediaWiki\Site\SiteStore.
Definition at line 48 of file HashSiteStore.php.
References MediaWiki\Site\HashSiteStore\saveSite().
Referenced by MediaWiki\Site\HashSiteStore\__construct().