Helper class for api modules to load entities.
More...
|
| loadEntityRevision (EntityId $entityId, $revId=0, $mode=null) |
| Load the entity content of the given revision.
|
|
Helper class for api modules to load entities.
- Copyright
- GPL-2.0-or-later
- Author
- Addshore
-
Daniel Kinzler
◆ __construct()
◆ getDefaultRetrievalMode()
Wikibase\Repo\Api\EntityLoadingHelper::getDefaultRetrievalMode |
( |
| ) |
|
◆ getEntityIdFromParams()
Wikibase\Repo\Api\EntityLoadingHelper::getEntityIdFromParams |
( |
array |
$params | ) |
|
- Parameters
-
- Returns
- EntityId|null
◆ getEntityIdFromSiteTitleCombination()
Wikibase\Repo\Api\EntityLoadingHelper::getEntityIdFromSiteTitleCombination |
( |
|
$site, |
|
|
|
$title |
|
) |
| |
|
private |
- Parameters
-
- Exceptions
-
ApiUsageException | If no such entity is found. |
- Returns
- EntityId The ID of the entity connected to $title on $site.
◆ getEntityIdFromString()
Wikibase\Repo\Api\EntityLoadingHelper::getEntityIdFromString |
( |
|
$id | ) |
|
|
private |
Returns an EntityId object based on the given $id, or throws a usage exception if the ID is invalid.
- Parameters
-
- Exceptions
-
- Returns
- EntityId
◆ getEntityIdParam()
Wikibase\Repo\Api\EntityLoadingHelper::getEntityIdParam |
( |
| ) |
|
Returns the name of the request parameter expected to contain the ID of the entity to load.
- Returns
- string
◆ loadEntity()
Wikibase\Repo\Api\EntityLoadingHelper::loadEntity |
( |
EntityId |
$entityId = null | ) |
|
- Parameters
-
EntityId | null | $entityId | ID of the entity to load. If not given, the ID is taken from the request parameters. If $entityId is given, it must be consistent with the 'baserevid' parameter. |
- Returns
- EntityDocument
◆ loadEntityRevision()
Wikibase\Repo\Api\EntityLoadingHelper::loadEntityRevision |
( |
EntityId |
$entityId, |
|
|
|
$revId = 0 , |
|
|
|
$mode = null |
|
) |
| |
|
protected |
Load the entity content of the given revision.
Will fail by calling dieException() $this->errorReporter if the revision cannot be found or cannot be loaded.
- Parameters
-
EntityId | $entityId | EntityId of the page to load the revision for |
int | $revId | The desired revision id, or 0 for the latest revision. |
string | null | $mode | LATEST_FROM_REPLICA, LATEST_FROM_REPLICA_WITH_FALLBACK or LATEST_FROM_MASTER (from EntityRevisionLookup). Null for the default. |
- Exceptions
-
ApiUsageException | |
LogicException | |
- Returns
- EntityRevision|null
◆ setDefaultRetrievalMode()
Wikibase\Repo\Api\EntityLoadingHelper::setDefaultRetrievalMode |
( |
|
$defaultRetrievalMode | ) |
|
- Parameters
-
string | $defaultRetrievalMode | Use the LATEST_XXX constants defined in EntityRevisionLookup |
◆ setEntityByLinkedTitleLookup()
◆ setEntityIdParam()
Wikibase\Repo\Api\EntityLoadingHelper::setEntityIdParam |
( |
|
$entityIdParam | ) |
|
Sets the name of the request parameter expected to contain the ID of the entity to load.
- Parameters
-
◆ $apiModule
Wikibase\Repo\Api\EntityLoadingHelper::$apiModule |
|
protected |
◆ $defaultRetrievalMode
Wikibase\Repo\Api\EntityLoadingHelper::$defaultRetrievalMode = LookupConstants::LATEST_FROM_REPLICA |
|
protected |
◆ $entityByLinkedTitleLookup
Wikibase\Repo\Api\EntityLoadingHelper::$entityByLinkedTitleLookup = null |
|
private |
◆ $entityIdParam
Wikibase\Repo\Api\EntityLoadingHelper::$entityIdParam = 'entity' |
|
private |
◆ $entityRevisionLookup
Wikibase\Repo\Api\EntityLoadingHelper::$entityRevisionLookup |
|
protected |
◆ $errorReporter
Wikibase\Repo\Api\EntityLoadingHelper::$errorReporter |
|
protected |
◆ $idParser
Wikibase\Repo\Api\EntityLoadingHelper::$idParser |
|
private |
The documentation for this class was generated from the following file: