/** * @deprecated since 0.8, use getSiteLinkList()->getBySiteId() instead. * @since 0.6 * * @param string $siteId * * @return SiteLink * @throws OutOfBoundsException */ public function getSiteLink($siteId) { return $this->siteLinks->getBySiteId($siteId); }
/** * @param SiteLinkList $siteLinks * @param string &$action * @param array &$commentArgs * * @return ItemId[] */ private function applyBadges(SiteLinkList $siteLinks, &$action, array &$commentArgs) { // If badges are not set in the change make sure they remain intact if ($this->badges === null) { return $siteLinks->hasLinkWithSiteId($this->siteId) ? $siteLinks->getBySiteId($this->siteId)->getBadges() : array(); } if ($this->badgesAreEmptyAndUnchanged($siteLinks)) { return array(); } $action .= $this->pageName === null ? '-badges' : '-both'; $commentArgs[] = $this->badges; return $this->badges; }
public function testGivenKnownSiteId_getBySiteIdReturnsSiteLink() { $link = new SiteLink('first', 'one'); $list = new SiteLinkList(array($link)); $this->assertEquals($link, $list->getBySiteId('first')); }