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

Service interface for retrieving EntityRevisions from storage. More...

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

Public Member Functions

 getEntityRevision (EntityId $entityId, $revisionId=0, $mode=LookupConstants::LATEST_FROM_REPLICA)
 Returns the entity revision with the provided id or null if there is no such entity or if access is forbidden.
 
 getLatestRevisionId (EntityId $entityId, $mode=LookupConstants::LATEST_FROM_REPLICA)
 Returns the id of the latest revision of the given entity, or false if there is no such entity.
 

Detailed Description

Service interface for retrieving EntityRevisions from storage.

Author
Daniel Kinzler

Member Function Documentation

◆ getEntityRevision()

Wikibase\Lib\Store\EntityRevisionLookup::getEntityRevision ( EntityId $entityId,
$revisionId = 0,
$mode = LookupConstants::LATEST_FROM_REPLICA )

Returns the entity revision with the provided id or null if there is no such entity or if access is forbidden.

If a $revisionId is given, the requested revision of the entity is loaded. If that revision does not exist or does not belong to the given entity, an exception is thrown.

Implementations of this method must not silently resolve redirects.

Parameters
EntityId$entityId
int | null$revisionIdThe desired revision id, or 0 for the latest revision.
string$modeLookupConstants::LATEST_FROM_REPLICA, LookupConstants::LATEST_FROM_REPLICA_WITH_FALLBACK or LookupConstants::LATEST_FROM_MASTER.
Exceptions
RevisionedUnresolvedRedirectException
StorageException
Returns
EntityRevision|null

Implemented in Wikibase\DataAccess\ByTypeDispatchingEntityRevisionLookup, Wikibase\Lib\Store\CacheRetrievingEntityRevisionLookup, Wikibase\Lib\Store\CachingEntityRevisionLookup, and Wikibase\Lib\Store\TypeDispatchingEntityRevisionLookup.

◆ getLatestRevisionId()

Wikibase\Lib\Store\EntityRevisionLookup::getLatestRevisionId ( EntityId $entityId,
$mode = LookupConstants::LATEST_FROM_REPLICA )

Returns the id of the latest revision of the given entity, or false if there is no such entity.

Implementations of this method must not silently resolve redirects. They can however return a LatestRevisionIdResult object containing information about the redirect.

Parameters
EntityId$entityId
string$modeLookupConstants::LATEST_FROM_REPLICA, LookupConstants::LATEST_FROM_REPLICA_WITH_FALLBACK or LookupConstants::LATEST_FROM_MASTER. LATEST_FROM_MASTER would force the revision to be determined from the canonical master database.
Returns
LatestRevisionIdResult

Implemented in Wikibase\DataAccess\ByTypeDispatchingEntityRevisionLookup, Wikibase\Lib\Store\CacheRetrievingEntityRevisionLookup, Wikibase\Lib\Store\CachingEntityRevisionLookup, and Wikibase\Lib\Store\TypeDispatchingEntityRevisionLookup.


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