MediaWiki  1.32.5
SiteList Class Reference
Inheritance diagram for SiteList:
Collaboration diagram for SiteList:

Public Member Functions

 getGlobalIdentifiers ()
 Returns all the global site identifiers. More...
 
 getGroup ( $groupName)
 Returns the sites that are in the provided group. More...
 
 getObjectType ()
 
 getSite ( $globalSiteId)
 Returns the Site with the provided global site identifier. More...
 
 getSiteByInternalId ( $id)
 Returns the Site with the provided site id. More...
 
 getSiteByNavigationId ( $id)
 Returns the Site with the provided navigational site id. More...
 
 hasInternalId ( $id)
 Returns if the list contains the site with the provided site id. More...
 
 hasNavigationId ( $id)
 Returns if the list contains the site with the provided navigational site id. More...
 
 hasSite ( $globalSiteId)
 Returns if the list contains the site with the provided global site identifier. More...
 
 isEmpty ()
 Returns if the list contains no sites. More...
 
 offsetUnset ( $index)
 
 removeSite ( $globalSiteId)
 Removes the site with the specified global site identifier. More...
 
 removeSiteByInternalId ( $id)
 Removes the site with the specified site id. More...
 
 removeSiteByNavigationId ( $id)
 Removes the site with the specified navigational site id. More...
 
 setSite (Site $site)
 Sets a site in the list. More...
 
 unserialize ( $serialization)
 
- Public Member Functions inherited from GenericArrayObject
 __construct ( $input=null, $flags=0, $iterator_class='ArrayIterator')
 
 append ( $value)
 
 offsetSet ( $index, $value)
 
 serialize ()
 

Static Public Member Functions

static getSerialVersionId ()
 Returns the version ID that identifies the serialization structure used by getSerializationData() and unserialize(), including the structure of any nested structures. More...
 

Protected Member Functions

 getSerializationData ()
 
 preSetElement ( $index, $site)
 
- Protected Member Functions inherited from GenericArrayObject
 getNewOffset ()
 Finds a new offset for when appending an element. More...
 
 hasValidType ( $value)
 Returns if the provided value has the same type as the elements that can be added to this ArrayObject. More...
 
 setElement ( $index, $value)
 Method that actually sets the element and holds all common code needed for set operations, including type checking and offset resolving. More...
 

Protected Attributes

array $byGlobalId = []
 Global site identifiers pointing to their sites offset value. More...
 
array $byInternalId = []
 Internal site identifiers pointing to their sites offset value. More...
 
array $byNavigationId = []
 Navigational site identifiers alias inter-language prefixes pointing to their sites offset value. More...
 
- Protected Attributes inherited from GenericArrayObject
int $indexOffset = 0
 

Detailed Description

Definition at line 29 of file SiteList.php.

Member Function Documentation

◆ getGlobalIdentifiers()

SiteList::getGlobalIdentifiers ( )

Returns all the global site identifiers.

Optionally only those belonging to the specified group.

Since
1.21
Returns
array

Definition at line 129 of file SiteList.php.

Referenced by SiteListTest\testGetGlobalIdentifiers(), and SiteListTest\testSerialization().

◆ getGroup()

SiteList::getGroup (   $groupName)

Returns the sites that are in the provided group.

Since
1.21
Parameters
string$groupName
Returns
SiteList

Definition at line 276 of file SiteList.php.

References as.

◆ getObjectType()

SiteList::getObjectType ( )
See also
GenericArrayObject::getObjectType
Since
1.21
Returns
string

Reimplemented from GenericArrayObject.

Definition at line 65 of file SiteList.php.

References class.

◆ getSerializationData()

SiteList::getSerializationData ( )
protected
See also
GenericArrayObject::getSerializationData
Since
1.21
Returns
array

Reimplemented from GenericArrayObject.

Definition at line 321 of file SiteList.php.

◆ getSerialVersionId()

static SiteList::getSerialVersionId ( )
static

Returns the version ID that identifies the serialization structure used by getSerializationData() 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.

Returns
string A string uniquely identifying the version of the serialization structure, including any sub-structures.

Definition at line 310 of file SiteList.php.

Referenced by CachingSiteStore\getCacheKey().

◆ getSite()

SiteList::getSite (   $globalSiteId)

Returns the Site with the provided global site identifier.

The site needs to exist, so if not sure, call hasGlobalId first.

Since
1.21
Parameters
string$globalSiteId
Returns
Site

Definition at line 154 of file SiteList.php.

Referenced by FileBasedSiteLookup\getSite(), CachingSiteStore\getSite(), and SiteListTest\testGetSiteByGlobalId().

◆ getSiteByInternalId()

SiteList::getSiteByInternalId (   $id)

Returns the Site with the provided site id.

The site needs to exist, so if not sure, call has first.

Since
1.21
Parameters
int$id
Returns
Site

Definition at line 202 of file SiteList.php.

◆ getSiteByNavigationId()

SiteList::getSiteByNavigationId (   $id)

Returns the Site with the provided navigational site id.

The site needs to exist, so if not sure, call has first.

Since
1.23
Parameters
string$id
Returns
Site

Definition at line 239 of file SiteList.php.

◆ hasInternalId()

SiteList::hasInternalId (   $id)

Returns if the list contains the site with the provided site id.

Parameters
int$id
Returns
bool

Definition at line 188 of file SiteList.php.

◆ hasNavigationId()

SiteList::hasNavigationId (   $id)

Returns if the list contains the site with the provided navigational site id.

Parameters
string$id
Returns
bool

Definition at line 225 of file SiteList.php.

◆ hasSite()

SiteList::hasSite (   $globalSiteId)

Returns if the list contains the site with the provided global site identifier.

Parameters
string$globalSiteId
Returns
bool

Definition at line 140 of file SiteList.php.

Referenced by FileBasedSiteLookup\getSite(), CachingSiteStore\getSite(), and preSetElement().

◆ isEmpty()

SiteList::isEmpty ( )

Returns if the list contains no sites.

Since
1.21
Returns
bool

Reimplemented from GenericArrayObject.

Definition at line 177 of file SiteList.php.

Referenced by SiteListTest\testIsEmpty().

◆ offsetUnset()

SiteList::offsetUnset (   $index)
See also
ArrayObject::offsetUnset()
Since
1.21
Parameters
mixed$index

Definition at line 102 of file SiteList.php.

References as.

Referenced by removeSite(), removeSiteByInternalId(), and removeSiteByNavigationId().

◆ preSetElement()

SiteList::preSetElement (   $index,
  $site 
)
protected
See also
GenericArrayObject::preSetElement
Since
1.21
Parameters
int | string$index
Site$site
Returns
bool

Reimplemented from GenericArrayObject.

Definition at line 79 of file SiteList.php.

References as, hasSite(), and removeSite().

◆ removeSite()

SiteList::removeSite (   $globalSiteId)

Removes the site with the specified global site identifier.

The site needs to exist, so if not sure, call hasGlobalId first.

Since
1.21
Parameters
string$globalSiteId

Definition at line 166 of file SiteList.php.

References offsetUnset().

Referenced by preSetElement().

◆ removeSiteByInternalId()

SiteList::removeSiteByInternalId (   $id)

Removes the site with the specified site id.

The site needs to exist, so if not sure, call has first.

Since
1.21
Parameters
int$id

Definition at line 214 of file SiteList.php.

References offsetUnset().

◆ removeSiteByNavigationId()

SiteList::removeSiteByNavigationId (   $id)

Removes the site with the specified navigational site id.

The site needs to exist, so if not sure, call has first.

Since
1.23
Parameters
string$id

Definition at line 251 of file SiteList.php.

References offsetUnset().

◆ setSite()

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.

Since
1.21
Parameters
Site$site

Definition at line 263 of file SiteList.php.

Referenced by SiteExporterTest\newSiteStore().

◆ unserialize()

SiteList::unserialize (   $serialization)
See also
GenericArrayObject::unserialize
Since
1.21
Parameters
string$serialization
Returns
array

Reimplemented from GenericArrayObject.

Definition at line 343 of file SiteList.php.

References unserialize().

Member Data Documentation

◆ $byGlobalId

array SiteList::$byGlobalId = []
protected

Global site identifiers pointing to their sites offset value.

Since
1.21

Array of string

Definition at line 46 of file SiteList.php.

◆ $byInternalId

array SiteList::$byInternalId = []
protected

Internal site identifiers pointing to their sites offset value.

Since
1.21

Array of integer

Definition at line 37 of file SiteList.php.

◆ $byNavigationId

array SiteList::$byNavigationId = []
protected

Navigational site identifiers alias inter-language prefixes pointing to their sites offset value.

Since
1.23

Array of string

Definition at line 56 of file SiteList.php.


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