MediaWiki master
|
Array-like collection of Site objects. More...
Inherits ArrayObject.
Public Member Functions | |
__construct ( $input=null, $flags=0, $iterator_class='ArrayIterator') | |
__serialize () | |
__unserialize ( $serializationData) | |
append ( $value) | |
getGlobalIdentifiers () | |
Returns all the global site identifiers. | |
getGroup ( $groupName) | |
Returns the sites that are in the provided group. | |
getObjectType () | |
The class or interface type that array elements must match. | |
getSite ( $globalSiteId) | |
Returns the Site with the provided global site identifier. | |
getSiteByInternalId ( $id) | |
Returns the Site with the provided site id. | |
getSiteByNavigationId ( $id) | |
Returns the Site with the provided navigational site id. | |
hasInternalId ( $id) | |
Returns if the list contains the site with the provided site id. | |
hasNavigationId ( $id) | |
Returns if the list contains the site with the provided navigational site id. | |
hasSite ( $globalSiteId) | |
Returns if the list contains the site with the provided global site identifier. | |
isEmpty () | |
Whether the list contains no sites. | |
offsetSet ( $index, $value) | |
offsetUnset ( $index) | |
removeSite ( $globalSiteId) | |
Removes the site with the specified global site identifier. | |
removeSiteByInternalId ( $id) | |
Removes the site with the specified site id. | |
removeSiteByNavigationId ( $id) | |
Removes the site with the specified navigational site id. | |
setSite (Site $site) | |
Sets a site in the list. | |
Static Public Member Functions | |
static | getSerialVersionId () |
Returns the version ID that identifies the serialization structure used by __serialize() and unserialize(), including the structure of any nested structures. | |
Protected Member Functions | |
getNewOffset () | |
Find a new offset for when appending an element. | |
hasValidType ( $value) | |
Returns if the provided value has the same type as the elements that can be added to this ArrayObject. | |
setElement ( $index, $site) | |
Actually set the element and enforce type checking and offset resolving. | |
Protected Attributes | |
array | $byGlobalId = [] |
Global site identifiers pointing to their sites offset value. | |
array | $byInternalId = [] |
Internal site identifiers pointing to their sites offset value. | |
array | $byNavigationId = [] |
Navigational site identifiers alias inter-language prefixes pointing to their sites offset value. | |
int | $indexOffset = 0 |
Array-like collection of Site objects.
This uses ArrayObject to intercept additions and deletions for purposes such as additional indexing, and to enforce that values are restricted to Site objects only.
Definition at line 32 of file SiteList.php.
SiteList::__construct | ( | $input = null , |
|
$flags = 0 , |
|||
$iterator_class = 'ArrayIterator' |
|||
) |
null | array | $input | |
int | $flags | |
string | $iterator_class |
Definition at line 75 of file SiteList.php.
References offsetSet().
SiteList::__serialize | ( | ) |
Definition at line 396 of file SiteList.php.
SiteList::__unserialize | ( | $serializationData | ) |
array | $serializationData |
Definition at line 415 of file SiteList.php.
SiteList::append | ( | $value | ) |
mixed | $value |
Definition at line 90 of file SiteList.php.
SiteList::getGlobalIdentifiers | ( | ) |
Returns all the global site identifiers.
Optionally only those belonging to the specified group.
Definition at line 207 of file SiteList.php.
SiteList::getGroup | ( | $groupName | ) |
Returns the sites that are in the provided group.
string | $groupName |
Definition at line 353 of file SiteList.php.
|
protected |
Find a new offset for when appending an element.
Definition at line 133 of file SiteList.php.
SiteList::getObjectType | ( | ) |
The class or interface type that array elements must match.
Definition at line 123 of file SiteList.php.
|
static |
Returns the version ID that identifies the serialization structure used by __serialize() and unserialize(), including the structure of any nested structures.
This is useful for constructing cache keys in cases where the cache relies on serialization for storing the SiteList.
Definition at line 387 of file SiteList.php.
SiteList::getSite | ( | $globalSiteId | ) |
Returns the Site with the provided global site identifier.
The site needs to exist, so if not sure, call hasGlobalId first.
string | $globalSiteId |
Definition at line 232 of file SiteList.php.
Referenced by CachingSiteStore\getSite().
SiteList::getSiteByInternalId | ( | $id | ) |
Returns the Site with the provided site id.
The site needs to exist, so if not sure, call has first.
int | $id |
Definition at line 279 of file SiteList.php.
SiteList::getSiteByNavigationId | ( | $id | ) |
Returns the Site with the provided navigational site id.
The site needs to exist, so if not sure, call has first.
string | $id |
Definition at line 316 of file SiteList.php.
SiteList::hasInternalId | ( | $id | ) |
Returns if the list contains the site with the provided site id.
int | $id |
Definition at line 265 of file SiteList.php.
SiteList::hasNavigationId | ( | $id | ) |
Returns if the list contains the site with the provided navigational site id.
string | $id |
Definition at line 302 of file SiteList.php.
SiteList::hasSite | ( | $globalSiteId | ) |
Returns if the list contains the site with the provided global site identifier.
string | $globalSiteId |
Definition at line 218 of file SiteList.php.
Referenced by CachingSiteStore\getSite().
|
protected |
Returns if the provided value has the same type as the elements that can be added to this ArrayObject.
mixed | $value |
Definition at line 112 of file SiteList.php.
SiteList::isEmpty | ( | ) |
Whether the list contains no sites.
Definition at line 254 of file SiteList.php.
SiteList::offsetSet | ( | $index, | |
$value | |||
) |
mixed | $index | |
mixed | $value |
Definition at line 100 of file SiteList.php.
Referenced by __construct().
SiteList::offsetUnset | ( | $index | ) |
mixed | $index |
Definition at line 180 of file SiteList.php.
SiteList::removeSite | ( | $globalSiteId | ) |
Removes the site with the specified global site identifier.
The site needs to exist, so if not sure, call hasGlobalId first.
string | $globalSiteId |
Definition at line 244 of file SiteList.php.
SiteList::removeSiteByInternalId | ( | $id | ) |
Removes the site with the specified site id.
The site needs to exist, so if not sure, call has first.
int | $id |
Definition at line 291 of file SiteList.php.
SiteList::removeSiteByNavigationId | ( | $id | ) |
Removes the site with the specified navigational site id.
The site needs to exist, so if not sure, call has first.
string | $id |
Definition at line 328 of file SiteList.php.
|
protected |
Actually set the element and enforce type checking and offset resolving.
int | string | null | $index | |
Site | $site |
Definition at line 148 of file SiteList.php.
SiteList::setSite | ( | Site | $site | ) |
Sets a site in the list.
If the site was not there, it will be added. If it was, it will be updated.
Site | $site |
Definition at line 340 of file SiteList.php.
|
protected |
Global site identifiers pointing to their sites offset value.
Maps string identifiers to local ArrayObject keys
Definition at line 56 of file SiteList.php.
|
protected |
Internal site identifiers pointing to their sites offset value.
Maps int identifiers to local ArrayObject keys
Definition at line 47 of file SiteList.php.
|
protected |
Navigational site identifiers alias inter-language prefixes pointing to their sites offset value.
Maps string identifiers to local ArrayObject keys
Definition at line 66 of file SiteList.php.
|
protected |