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 37 of file SiteList.php.
MediaWiki\Site\SiteList::__construct | ( | $input = null, | |
$flags = 0, | |||
$iterator_class = 'ArrayIterator' ) |
null | array | $input | |
int | $flags | |
string | $iterator_class |
Definition at line 80 of file SiteList.php.
References MediaWiki\Site\SiteList\offsetSet().
MediaWiki\Site\SiteList::__serialize | ( | ) |
Definition at line 400 of file SiteList.php.
MediaWiki\Site\SiteList::__unserialize | ( | $serializationData | ) |
array | $serializationData |
Definition at line 419 of file SiteList.php.
MediaWiki\Site\SiteList::append | ( | $value | ) |
mixed | $value |
Definition at line 95 of file SiteList.php.
MediaWiki\Site\SiteList::getGlobalIdentifiers | ( | ) |
Returns all the global site identifiers.
Optionally only those belonging to the specified group.
Definition at line 211 of file SiteList.php.
MediaWiki\Site\SiteList::getGroup | ( | $groupName | ) |
Returns the sites that are in the provided group.
string | $groupName |
Definition at line 357 of file SiteList.php.
|
protected |
Find a new offset for when appending an element.
Definition at line 138 of file SiteList.php.
MediaWiki\Site\SiteList::getObjectType | ( | ) |
The class or interface type that array elements must match.
Definition at line 128 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 391 of file SiteList.php.
MediaWiki\Site\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 236 of file SiteList.php.
Referenced by MediaWiki\Site\CachingSiteStore\getSite().
MediaWiki\Site\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 283 of file SiteList.php.
MediaWiki\Site\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 320 of file SiteList.php.
MediaWiki\Site\SiteList::hasInternalId | ( | $id | ) |
Returns if the list contains the site with the provided site id.
int | $id |
Definition at line 269 of file SiteList.php.
MediaWiki\Site\SiteList::hasNavigationId | ( | $id | ) |
Returns if the list contains the site with the provided navigational site id.
string | $id |
Definition at line 306 of file SiteList.php.
MediaWiki\Site\SiteList::hasSite | ( | $globalSiteId | ) |
Returns if the list contains the site with the provided global site identifier.
string | $globalSiteId |
Definition at line 222 of file SiteList.php.
Referenced by MediaWiki\Site\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 117 of file SiteList.php.
MediaWiki\Site\SiteList::isEmpty | ( | ) |
Whether the list contains no sites.
Definition at line 258 of file SiteList.php.
MediaWiki\Site\SiteList::offsetSet | ( | $index, | |
$value ) |
mixed | $index | |
mixed | $value |
Definition at line 105 of file SiteList.php.
Referenced by MediaWiki\Site\SiteList\__construct().
MediaWiki\Site\SiteList::offsetUnset | ( | $index | ) |
mixed | $index |
Definition at line 184 of file SiteList.php.
MediaWiki\Site\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 248 of file SiteList.php.
MediaWiki\Site\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 295 of file SiteList.php.
MediaWiki\Site\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 332 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 153 of file SiteList.php.
MediaWiki\Site\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 344 of file SiteList.php.
|
protected |
Global site identifiers pointing to their sites offset value.
Maps string identifiers to local ArrayObject keys
Definition at line 61 of file SiteList.php.
|
protected |
Internal site identifiers pointing to their sites offset value.
Maps int identifiers to local ArrayObject keys
Definition at line 52 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 71 of file SiteList.php.
|
protected |