|
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 ( $revisionId, EntityId $redirectsTo) |
| static | nonexistentEntity () |
| static | concreteRevision ( $revisionId) |
Private Member Functions | |
| __construct ( $type) | |
Static Private Member Functions | |
| static | assertCorrectRevisionId ( $revisionId) |
Private Attributes | |
| const | REDIRECT = 'redirect' |
| Constants to specify type of the result. | |
| const | NONEXISTENT = 'nonexistent' |
| const | CONCRETE_REVISION = 'concrete revision' |
| $type | |
| $handlers = [] | |
| $revisionId | |
| $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 |
| mixed | $revisionId | Expected positive integer |
Exception
|
static |
| int | $revisionId |
| 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 |
Constants to specify type of the result.