Wikibase
MediaWiki Wikibase extension
|
An EntityRevisionLookup that dispatches by entity type to inner EntityRevisionLookups. More...
Public Member Functions | ||||||||||
__construct (array $lookups) | ||||||||||
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.
| ||||||||||
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.
| ||||||||||
Private Member Functions | |
getLookupForEntity (EntityId $entityId) | |
Private Attributes | |
$lookups | |
An EntityRevisionLookup that dispatches by entity type to inner EntityRevisionLookups.
If no lookup is registered for the entity type the lookup will fail in an unexceptional way.
TODO Wikibase\Lib\Store\TypeDispatchingEntityRevisionLookup is similar, but a bit different, also conceptually. The other class could maybe be renamed or so?
TODO this has been introduced into data-access with a couple of points that still bind to wikibase lib and other parts of mediawiki, these should be cleaned up:
Wikibase\DataAccess\ByTypeDispatchingEntityRevisionLookup::__construct | ( | array | $lookups | ) |
Wikibase\DataAccess\ByTypeDispatchingEntityRevisionLookup::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. |
Implements Wikibase\Lib\Store\EntityRevisionLookup.
Wikibase\DataAccess\ByTypeDispatchingEntityRevisionLookup::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. |
Implements Wikibase\Lib\Store\EntityRevisionLookup.
|
private |
|
private |