|
MediaWiki master
|
Array-like collection of Site objects. More...
Inherits ArrayObject, and ArrayObject.

Public Member Functions | |
| __construct ( $input=null, $flags=0, $iterator_class=ArrayIterator::class) | |
| __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 25 of file SiteList.php.
| MediaWiki\Site\SiteList::__construct | ( | $input = null, | |
| $flags = 0, | |||
| $iterator_class = ArrayIterator::class ) |
| null | array | $input | |
| int | $flags | |
| class-string<ArrayIterator> | $iterator_class |
Definition at line 68 of file SiteList.php.
References MediaWiki\Site\SiteList\offsetSet().
| MediaWiki\Site\SiteList::__serialize | ( | ) |
Definition at line 397 of file SiteList.php.
| MediaWiki\Site\SiteList::__unserialize | ( | $serializationData | ) |
| array | $serializationData |
Definition at line 416 of file SiteList.php.
| MediaWiki\Site\SiteList::append | ( | $value | ) |
| mixed | $value |
Definition at line 83 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 205 of file SiteList.php.
| MediaWiki\Site\SiteList::getGroup | ( | $groupName | ) |
Returns the sites that are in the provided group.
| string | $groupName |
Definition at line 354 of file SiteList.php.
|
protected |
Find a new offset for when appending an element.
Definition at line 126 of file SiteList.php.
| MediaWiki\Site\SiteList::getObjectType | ( | ) |
The class or interface type that array elements must match.
Definition at line 116 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 388 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 230 of file SiteList.php.
| 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 279 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 317 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 264 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 303 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 216 of file SiteList.php.
|
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 105 of file SiteList.php.
| MediaWiki\Site\SiteList::isEmpty | ( | ) |
Whether the list contains no sites.
Definition at line 252 of file SiteList.php.
| MediaWiki\Site\SiteList::offsetSet | ( | $index, | |
| $value ) |
| mixed | $index | |
| mixed | $value |
Definition at line 93 of file SiteList.php.
Referenced by MediaWiki\Site\SiteList\__construct().
| MediaWiki\Site\SiteList::offsetUnset | ( | $index | ) |
| mixed | $index |
Definition at line 175 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 242 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 292 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 329 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 141 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 341 of file SiteList.php.
|
protected |
Global site identifiers pointing to their sites offset value.
Maps string identifiers to local ArrayObject keys
Definition at line 49 of file SiteList.php.
|
protected |
Internal site identifiers pointing to their sites offset value.
Maps int identifiers to local ArrayObject keys
Definition at line 40 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 59 of file SiteList.php.
|
protected |