Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Lib\Store\SiteLinkLookup Interface Reference

Contains methods to lookup of sitelinks of lookup by sitelinks. More...

+ Inheritance diagram for Wikibase\Lib\Store\SiteLinkLookup:

Public Member Functions

 getItemIdForLink ( $globalSiteId, $pageTitle)
 Returns the id of the item that is equivalent to the provided page, or null if there is none.
 
 getLinks (array $numericIds=[], array $siteIds=[], array $pageNames=[])
 Returns the links that match the provided conditions.
 
 getSiteLinksForItem (ItemId $itemId)
 Returns an array of SiteLink objects for an item.
 
 getItemIdForSiteLink (SiteLink $siteLink)
 

Detailed Description

Contains methods to lookup of sitelinks of lookup by sitelinks.

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

Member Function Documentation

◆ getItemIdForLink()

Wikibase\Lib\Store\SiteLinkLookup::getItemIdForLink (   $globalSiteId,
  $pageTitle 
)

Returns the id of the item that is equivalent to the provided page, or null if there is none.

Parameters
string$globalSiteId
string$pageTitle
Returns
ItemId|null

Implemented in Wikibase\Lib\Store\CachingSiteLinkLookup, Wikibase\Lib\Store\HashSiteLinkStore, and Wikibase\Lib\Store\Sql\SiteLinkTable.

◆ getItemIdForSiteLink()

Wikibase\Lib\Store\SiteLinkLookup::getItemIdForSiteLink ( SiteLink  $siteLink)

◆ getLinks()

Wikibase\Lib\Store\SiteLinkLookup::getLinks ( array  $numericIds = [],
array  $siteIds = [],
array  $pageNames = [] 
)

Returns the links that match the provided conditions.

The links are returned as arrays with the following elements in specified order:

  • string siteId
  • string pageName
  • int itemId Numeric (unprefixed) item id

Note: if the conditions are not very selective the result set can be very big. Thus the caller is responsible for not executing too expensive queries in its context.

Parameters
int[]$numericIdsNumeric (unprefixed) item ids
string[]$siteIds
string[]$pageNames
Returns
array[]

Implemented in Wikibase\Lib\Store\CachingSiteLinkLookup, and Wikibase\Lib\Store\Sql\SiteLinkTable.

◆ getSiteLinksForItem()

Wikibase\Lib\Store\SiteLinkLookup::getSiteLinksForItem ( ItemId  $itemId)

Returns an array of SiteLink objects for an item.

If the item isn't known or not an Item, an empty array is returned.

Parameters
ItemId$itemId
Returns
SiteLink[]

Implemented in Wikibase\Lib\Store\CachingSiteLinkLookup, Wikibase\Lib\Store\HashSiteLinkStore, and Wikibase\Lib\Store\Sql\SiteLinkTable.


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