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 (string $globalSiteId, string $pageTitle)
 Returns the id of the item that is equivalent to the provided page, or null if there is none.
 
 getLinks (?array $numericIds=null, ?array $siteIds=null, ?array $pageNames=null)
 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 ( string $globalSiteId,
string $pageTitle )

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

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 = null,
?array $siteIds = null,
?array $pageNames = null )

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[] | null$numericIdsNumeric (unprefixed) item ids, or null for no item filtering
string[] | null$siteIdsSite IDs, or null for no site filtering
string[] | null$pageNamesPage names, or null for no page filtering
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: