|
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 23 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 66 of file SiteList.php.
References MediaWiki\Site\SiteList\offsetSet().
| MediaWiki\Site\SiteList::__serialize | ( | ) |
Definition at line 392 of file SiteList.php.
| MediaWiki\Site\SiteList::__unserialize | ( | $serializationData | ) |
| array | $serializationData |
Definition at line 411 of file SiteList.php.
| MediaWiki\Site\SiteList::append | ( | $value | ) |
| mixed | $value |
Definition at line 81 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 203 of file SiteList.php.
| MediaWiki\Site\SiteList::getGroup | ( | $groupName | ) |
Returns the sites that are in the provided group.
| string | $groupName |
Definition at line 349 of file SiteList.php.
|
protected |
Find a new offset for when appending an element.
Definition at line 124 of file SiteList.php.
| MediaWiki\Site\SiteList::getObjectType | ( | ) |
The class or interface type that array elements must match.
Definition at line 114 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 383 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 228 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 275 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 312 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 261 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 298 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 214 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 103 of file SiteList.php.
| MediaWiki\Site\SiteList::isEmpty | ( | ) |
Whether the list contains no sites.
Definition at line 250 of file SiteList.php.
| MediaWiki\Site\SiteList::offsetSet | ( | $index, | |
| $value ) |
| mixed | $index | |
| mixed | $value |
Definition at line 91 of file SiteList.php.
Referenced by MediaWiki\Site\SiteList\__construct().
| MediaWiki\Site\SiteList::offsetUnset | ( | $index | ) |
| mixed | $index |
Definition at line 173 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 240 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 287 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 324 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 139 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 336 of file SiteList.php.
|
protected |
Global site identifiers pointing to their sites offset value.
Maps string identifiers to local ArrayObject keys
Definition at line 47 of file SiteList.php.
|
protected |
Internal site identifiers pointing to their sites offset value.
Maps int identifiers to local ArrayObject keys
Definition at line 38 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 57 of file SiteList.php.
|
protected |