Wikibase
MediaWiki Wikibase extension
Wikibase\DataModel\SiteLinkList Class Reference

Unordered collection of SiteLink objects. More...

+ Inheritance diagram for Wikibase\DataModel\SiteLinkList:
+ Collaboration diagram for Wikibase\DataModel\SiteLinkList:

Public Member Functions

 __construct ($siteLinks=[])
 
 addSiteLink (SiteLink $link)
 
 addNewSiteLink ( $siteId, $pageName, $badges=null)
 
 setSiteLink (SiteLink $link)
 
 setNewSiteLink ( $siteId, $pageName, $badges=null)
 
 getIterator ()
 
 count ()
 
 getBySiteId ( $siteId)
 
 hasLinkWithSiteId ( $siteId)
 
 equals ( $target)
 
 isEmpty ()
 
 toArray ()
 
 removeLinkWithSiteId ( $siteId)
 

Private Attributes

 $siteLinks = []
 

Detailed Description

Unordered collection of SiteLink objects.

SiteLink objects can be accessed by site id. Only one SiteLink per site id can exist in the collection.

Since
0.7
Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >

Constructor & Destructor Documentation

◆ __construct()

Wikibase\DataModel\SiteLinkList::__construct (   $siteLinks = [])
Parameters
iterable | SiteLink[]$siteLinksCan be a non-array iterable since 8.1
Exceptions
InvalidArgumentException

Member Function Documentation

◆ addNewSiteLink()

Wikibase\DataModel\SiteLinkList::addNewSiteLink (   $siteId,
  $pageName,
  $badges = null 
)
See also
SiteLink::__construct
Since
0.8
Parameters
string$siteId
string$pageName
ItemIdSet | ItemId[] | null$badges
Exceptions
InvalidArgumentException

◆ addSiteLink()

Wikibase\DataModel\SiteLinkList::addSiteLink ( SiteLink  $link)
Since
0.8
Parameters
SiteLink$link
Exceptions
InvalidArgumentException

◆ count()

Wikibase\DataModel\SiteLinkList::count ( )
See also
Countable::count
Returns
int

◆ equals()

Wikibase\DataModel\SiteLinkList::equals (   $target)
Since
0.7.4
Parameters
mixed$target
Returns
bool

◆ getBySiteId()

Wikibase\DataModel\SiteLinkList::getBySiteId (   $siteId)
Parameters
string$siteId
Returns
SiteLink
Exceptions
OutOfBoundsException
InvalidArgumentException

◆ getIterator()

Wikibase\DataModel\SiteLinkList::getIterator ( )
See also
IteratorAggregate::getIterator

Returns an Iterator of SiteLink in which the keys are the site ids.

Returns
Iterator|SiteLink[]

◆ hasLinkWithSiteId()

Wikibase\DataModel\SiteLinkList::hasLinkWithSiteId (   $siteId)
Since
0.8
Parameters
string$siteId
Returns
boolean
Exceptions
InvalidArgumentException

◆ isEmpty()

Wikibase\DataModel\SiteLinkList::isEmpty ( )
Since
1.0
Returns
bool

◆ removeLinkWithSiteId()

Wikibase\DataModel\SiteLinkList::removeLinkWithSiteId (   $siteId)
Since
0.8
Parameters
string$siteId
Exceptions
InvalidArgumentException

◆ setNewSiteLink()

Wikibase\DataModel\SiteLinkList::setNewSiteLink (   $siteId,
  $pageName,
  $badges = null 
)
Since
2.5
Parameters
string$siteId
string$pageName
ItemIdSet | ItemId[] | null$badges

◆ setSiteLink()

Wikibase\DataModel\SiteLinkList::setSiteLink ( SiteLink  $link)
Since
2.5
Parameters
SiteLink$link

◆ toArray()

Wikibase\DataModel\SiteLinkList::toArray ( )
Since
2.5
Returns
SiteLink[] Array indexed by site id.

Member Data Documentation

◆ $siteLinks

Wikibase\DataModel\SiteLinkList::$siteLinks = []
private

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