MediaWiki  REL1_22
SiteSQLStore Class Reference
Inheritance diagram for SiteSQLStore:
Collaboration diagram for SiteSQLStore:

List of all members.

Public Member Functions

 clear ()
 Clears the list of sites stored in the database.
 getSite ($globalId, $source= 'cache')
 getSites ($source= 'cache')
 reset ()
 Purges the internal and external cache of the site list, forcing the list of sites to be re-read from the database.
 saveSite (Site $site)
 saveSites (array $sites)

Static Public Member Functions

static newInstance (ORMTable $sitesTable=null)

Protected Member Functions

 __construct (ORMTable $sitesTable=null)
 Constructor.
 getCacheKey ()
 Constructs a cache key to use for caching the list of sites.
 getRowFromSite (Site $site)
 Get a new ORMRow from a Site object.
 loadSites ()
 Fetches the site from the database and loads them into the sites field.
 newSitesTable ()
 siteFromRow (ORMRow $siteRow)
 Returns a new Site object constructed from the provided ORMRow.

Protected Attributes

SiteList null $sites = null
ORMTable $sitesTable

Private Attributes

string null $cacheKey = null
int $cacheTimeout = 3600

Detailed Description

Definition at line 31 of file SiteSQLStore.php.


Constructor & Destructor Documentation

SiteSQLStore::__construct ( ORMTable sitesTable = null) [protected]

Constructor.

Since:
1.21
Parameters:
ORMTable | null$sitesTable

Definition at line 69 of file SiteSQLStore.php.


Member Function Documentation

Clears the list of sites stored in the database.

See also:
SiteStore::clear()
Returns:
bool success

Implements SiteStore.

Definition at line 391 of file SiteSQLStore.php.

SiteSQLStore::getCacheKey ( ) [protected]

Constructs a cache key to use for caching the list of sites.

This includes the concrete class name of the site list as well as a version identifier for the list's serialization, to avoid problems when unserializing site lists serialized by an older version, e.g. when reading from a cache.

The cache key also includes information about where the sites were loaded from, e.g. the name of a database table.

See also:
SiteList::getSerialVersionId
Returns:
String The cache key.

Definition at line 91 of file SiteSQLStore.php.

SiteSQLStore::getRowFromSite ( Site site) [protected]

Get a new ORMRow from a Site object.

Since:
1.22
Parameters:
Site
Returns:
ORMRow

Definition at line 196 of file SiteSQLStore.php.

SiteSQLStore::getSite ( globalId,
source = 'cache' 
)
See also:
SiteStore::getSite
Since:
1.21
Parameters:
string$globalId
string$source
Returns:
Site|null

Implements SiteStore.

Definition at line 270 of file SiteSQLStore.php.

SiteSQLStore::getSites ( source = 'cache')
See also:
SiteStore::getSites
Since:
1.21
Parameters:
string$sourceeither 'cache' or 'recache'
Returns:
SiteList

Implements SiteStore.

Definition at line 118 of file SiteSQLStore.php.

SiteSQLStore::loadSites ( ) [protected]

Fetches the site from the database and loads them into the sites field.

Since:
1.21

Definition at line 225 of file SiteSQLStore.php.

static SiteSQLStore::newInstance ( ORMTable sitesTable = null) [static]
SiteSQLStore::newSitesTable ( ) [protected]
Since:
1.21
Returns:
ORMTable

Definition at line 419 of file SiteSQLStore.php.

Purges the internal and external cache of the site list, forcing the list of sites to be re-read from the database.

Since:
1.21

Definition at line 374 of file SiteSQLStore.php.

See also:
SiteStore::saveSite
Since:
1.21
Parameters:
Site$site
Returns:
boolean Success indicator

Implements SiteStore.

Definition at line 288 of file SiteSQLStore.php.

See also:
SiteStore::saveSites
Since:
1.21
Parameters:
Site[]$sites
Returns:
boolean Success indicator

Implements SiteStore.

Definition at line 301 of file SiteSQLStore.php.

SiteSQLStore::siteFromRow ( ORMRow siteRow) [protected]

Returns a new Site object constructed from the provided ORMRow.

Since:
1.21
Parameters:
ORMRow$siteRow
Returns:
Site

Definition at line 150 of file SiteSQLStore.php.


Member Data Documentation

string null SiteSQLStore::$cacheKey = null [private]

Definition at line 45 of file SiteSQLStore.php.

int SiteSQLStore::$cacheTimeout = 3600 [private]

Definition at line 49 of file SiteSQLStore.php.

SiteList null SiteSQLStore::$sites = null [protected]
Since:
1.21

Definition at line 37 of file SiteSQLStore.php.

ORMTable SiteSQLStore::$sitesTable [protected]

Definition at line 41 of file SiteSQLStore.php.


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