Wikibase
MediaWiki Wikibase extension
|
Represents result of \Wikibase\Lib\Store\EntityRevisionLookup::getLatestRevisionId
method call.
More...
Public Member Functions | |
onConcreteRevision (callable $handler) | |
onRedirect (callable $handler) | |
onNonexistentEntity (callable $handler) | |
map () | |
Static Public Member Functions | |
static | redirect (int $revisionId, EntityId $redirectsTo) |
static | nonexistentEntity () |
static | concreteRevision (int $revisionId, string $revisionTimestamp) |
Private Member Functions | |
__construct ( $type) | |
Static Private Member Functions | |
static | assertCorrectRevisionId (int $revisionId) |
Private Attributes | |
const | REDIRECT = 'redirect' |
Constants to specify type of the result. | |
const | NONEXISTENT = 'nonexistent' |
const | CONCRETE_REVISION = 'concrete revision' |
$type | |
$handlers = [] | |
$revisionId | |
$revisionTimestamp | |
$redirectsTo | |
Represents result of \Wikibase\Lib\Store\EntityRevisionLookup::getLatestRevisionId
method call.
Is immutable.
The idea behind the design is to force developer to handle all the possible cases.
How to create:
Example of usage:
|
private |
|
staticprivate |
int | $revisionId | Expected positive integer |
Exception
|
static |
Wikibase\Lib\Store\LatestRevisionIdResult::map | ( | ) |
Exception If target handler throws an exception
LogicException If not all the handlers are specified
|
static |
Wikibase\Lib\Store\LatestRevisionIdResult::onConcreteRevision | ( | callable | $handler | ) |
callable | $handler | Revision id will be given as a first argument |
Wikibase\Lib\Store\LatestRevisionIdResult::onNonexistentEntity | ( | callable | $handler | ) |
callable | $handler | Function with no arguments |
Wikibase\Lib\Store\LatestRevisionIdResult::onRedirect | ( | callable | $handler | ) |
callable | $handler | Revision id will be given as a first argument, EntityId to which revision redirects will be second argument |
|
static |
int | $revisionId | |
EntityId | $redirectsTo | (could be another redirect) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Constants to specify type of the result.