Represents result of \Wikibase\Lib\Store\EntityRevisionLookup::getLatestRevisionId
method call.
More...
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:
static nonexistentEntity()
Definition: LatestRevisionIdResult.php:88
static concreteRevision( $revisionId)
Definition: LatestRevisionIdResult.php:96
static redirect( $revisionId, EntityId $redirectsTo)
Definition: LatestRevisionIdResult.php:75
Example of usage:
return 'redirect';
} )
return 'nonexistent';
} )
return 'concrete';
} )
map()
Definition: LatestRevisionIdResult.php:147
$redirectsTo
Definition: LatestRevisionIdResult.php:68
onConcreteRevision(callable $handler)
Definition: LatestRevisionIdResult.php:112
onNonexistentEntity(callable $handler)
Definition: LatestRevisionIdResult.php:135
$revisionId
Definition: LatestRevisionIdResult.php:63
- See also
- \Wikibase\Lib\Store\EntityRevisionLookup::getLatestRevisionId
- Copyright
- GPL-2.0-or-later
◆ __construct()
Wikibase\Lib\Store\LatestRevisionIdResult::__construct |
( |
|
$type | ) |
|
|
private |
◆ assertCorrectRevisionId()
static Wikibase\Lib\Store\LatestRevisionIdResult::assertCorrectRevisionId |
( |
|
$revisionId | ) |
|
|
staticprivate |
- Parameters
-
mixed | $revisionId | Expected positive integer |
- Exceptions
-
◆ concreteRevision()
static Wikibase\Lib\Store\LatestRevisionIdResult::concreteRevision |
( |
|
$revisionId | ) |
|
|
static |
◆ map()
Wikibase\Lib\Store\LatestRevisionIdResult::map |
( |
| ) |
|
- Returns
- mixed Returns value returned by one of the map functions
- Exceptions
-
◆ nonexistentEntity()
static Wikibase\Lib\Store\LatestRevisionIdResult::nonexistentEntity |
( |
| ) |
|
|
static |
◆ onConcreteRevision()
Wikibase\Lib\Store\LatestRevisionIdResult::onConcreteRevision |
( |
callable |
$handler | ) |
|
- Parameters
-
callable | $handler | Revision id will be given as a first argument |
- Returns
- self
◆ onNonexistentEntity()
Wikibase\Lib\Store\LatestRevisionIdResult::onNonexistentEntity |
( |
callable |
$handler | ) |
|
- Parameters
-
callable | $handler | Function with no arguments |
- Returns
- self
◆ onRedirect()
Wikibase\Lib\Store\LatestRevisionIdResult::onRedirect |
( |
callable |
$handler | ) |
|
- Parameters
-
callable | $handler | Revision id will be given as a first argument, EntityId to which revision redirects will be second argument |
- Returns
- self
◆ redirect()
static Wikibase\Lib\Store\LatestRevisionIdResult::redirect |
( |
|
$revisionId, |
|
|
EntityId |
$redirectsTo |
|
) |
| |
|
static |
- Parameters
-
int | $revisionId | |
EntityId | $redirectsTo | (could be another redirect) |
- Returns
- self
◆ $handlers
Wikibase\Lib\Store\LatestRevisionIdResult::$handlers = [] |
|
private |
◆ $redirectsTo
Wikibase\Lib\Store\LatestRevisionIdResult::$redirectsTo |
|
private |
◆ $revisionId
Wikibase\Lib\Store\LatestRevisionIdResult::$revisionId |
|
private |
◆ $type
Wikibase\Lib\Store\LatestRevisionIdResult::$type |
|
private |
◆ CONCRETE_REVISION
const Wikibase\Lib\Store\LatestRevisionIdResult::CONCRETE_REVISION = 'concrete revision' |
|
private |
◆ NONEXISTENT
const Wikibase\Lib\Store\LatestRevisionIdResult::NONEXISTENT = 'nonexistent' |
|
private |
◆ REDIRECT
const Wikibase\Lib\Store\LatestRevisionIdResult::REDIRECT = 'redirect' |
|
private |
Constants to specify type of the result.
The documentation for this class was generated from the following file: