Wikibase
MediaWiki Wikibase extension
Wikibase\Lib\Store\EntityTitleLookup Interface Reference

Represents an arbitrary mapping from entity IDs to wiki page titles, with no further guarantees given. More...

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

Public Member Functions

 getTitleForId (EntityId $id)
 Returns the Title for the given entity. More...
 
 getTitlesForIds (array $ids)
 Returns an array of Titles for the given entity ids, indexed by the id serialization. More...
 

Detailed Description

Represents an arbitrary mapping from entity IDs to wiki page titles, with no further guarantees given.

The resulting title does not necessarily represent the page that actually stores the entity contents.

The mapping could be programmatic, or it could be based on database lookups.

Author
Daniel Kinzler

Member Function Documentation

◆ getTitleForId()

Wikibase\Lib\Store\EntityTitleLookup::getTitleForId ( EntityId  $id)

Returns the Title for the given entity.

If the entity does not exist, this method will return either null, or a Title object referring to a page that does not exist.

Todo:
change this to return a TitleValue
Parameters
EntityId$id
Exceptions
MWException
OutOfBoundsException
InvalidArgumentException
Returns
Title|null

Implemented in Wikibase\Repo\Store\TypeDispatchingEntityTitleStoreLookup, Wikibase\Repo\Content\ContentHandlerEntityTitleLookup, and Wikibase\Client\DataAccess\ClientSiteLinkTitleLookup.

◆ getTitlesForIds()

Wikibase\Lib\Store\EntityTitleLookup::getTitlesForIds ( array  $ids)

Returns an array of Titles for the given entity ids, indexed by the id serialization.

If an entity does not exist, the array element for the relevant id serialization will be null

Parameters
EntityId[]$ids
Exceptions
MWException
OutOfBoundsException
InvalidArgumentException
Returns
(Title|null)[]

Implemented in Wikibase\Repo\Store\TypeDispatchingEntityTitleStoreLookup, and Wikibase\Repo\Content\ContentHandlerEntityTitleLookup.


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