Wikibase
MediaWiki Wikibase extension
|
Service interface for retrieving EntityRevisions from storage. More...
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. More... | |
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. More... | |
Service interface for retrieving EntityRevisions from storage.
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.
EntityId | $entityId | |
int | null | $revisionId | The desired revision id, or 0 for the latest revision. |
string | $mode | LookupConstants::LATEST_FROM_REPLICA, LookupConstants::LATEST_FROM_REPLICA_WITH_FALLBACK or LookupConstants::LATEST_FROM_MASTER. |
Implemented in Wikibase\Lib\Store\TypeDispatchingEntityRevisionLookup, Wikibase\Lib\Store\CachingEntityRevisionLookup, Wikibase\Lib\Store\CacheRetrievingEntityRevisionLookup, and Wikibase\DataAccess\ByTypeDispatchingEntityRevisionLookup.
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.
EntityId | $entityId | |
string | $mode | LookupConstants::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. |
Implemented in Wikibase\Lib\Store\TypeDispatchingEntityRevisionLookup, Wikibase\Lib\Store\CachingEntityRevisionLookup, Wikibase\Lib\Store\CacheRetrievingEntityRevisionLookup, and Wikibase\DataAccess\ByTypeDispatchingEntityRevisionLookup.