Wikibase
MediaWiki Wikibase extension
|
An interactor implementing the use case of creating a redirect. More...
Public Member Functions | |
__construct (EntityRevisionLookup $entityRevisionLookup, EntityStore $entityStore, EntityPermissionChecker $permissionChecker, SummaryFormatter $summaryFormatter, User $user, EditFilterHookRunner $editFilterHookRunner, EntityRedirectLookup $entityRedirectLookup, EntityTitleStoreLookup $entityTitleLookup) | |
createRedirect (EntityId $fromId, EntityId $toId, $bot) | |
Create a redirect at $fromId pointing to $toId. More... | |
Protected Member Functions | |
assertEntityIsRedirectable (EntityDocument $entity) | |
Used to assert that the source entity is redirectable. More... | |
Private Member Functions | |
checkPermissions (EntityId $entityId) | |
Check user's permissions for the given entity ID. More... | |
checkCanCreateRedirect (EntityId $entityId) | |
checkExistsNoRedirect (EntityId $entityId) | |
checkCompatible (EntityId $fromId, EntityId $toId) | |
checkSourceAndTargetNotTheSame (EntityId $fromId, EntityId $toId) | |
saveRedirect (EntityRedirect $redirect, FormatableSummary $summary, $bot) | |
Private Attributes | |
$entityTitleLookup | |
$entityRevisionLookup | |
$entityStore | |
$permissionChecker | |
$summaryFormatter | |
$user | |
$editFilterHookRunner | |
$entityRedirectLookup | |
An interactor implementing the use case of creating a redirect.
Wikibase\Repo\Interactors\EntityRedirectCreationInteractor::__construct | ( | EntityRevisionLookup | $entityRevisionLookup, |
EntityStore | $entityStore, | ||
EntityPermissionChecker | $permissionChecker, | ||
SummaryFormatter | $summaryFormatter, | ||
User | $user, | ||
EditFilterHookRunner | $editFilterHookRunner, | ||
EntityRedirectLookup | $entityRedirectLookup, | ||
EntityTitleStoreLookup | $entityTitleLookup | ||
) |
|
abstractprotected |
Used to assert that the source entity is redirectable.
This can differ depending on the entity type.
EntityDocument | $entity |
RedirectCreationException |
Reimplemented in Wikibase\Repo\Interactors\ItemRedirectCreationInteractor.
|
private |
EntityId | $entityId |
RedirectCreationException |
|
private |
EntityId | $fromId | |
EntityId | $toId |
RedirectCreationException |
|
private |
EntityId | $entityId |
RedirectCreationException |
|
private |
Check user's permissions for the given entity ID.
EntityId | $entityId |
RedirectCreationException | if the permission check fails |
|
private |
Wikibase\Repo\Interactors\EntityRedirectCreationInteractor::createRedirect | ( | EntityId | $fromId, |
EntityId | $toId, | ||
$bot | |||
) |
Create a redirect at $fromId pointing to $toId.
EntityId | $fromId | The ID of the entity to be replaced by the redirect. The entity must exist and be empty (or be a redirect already). |
EntityId | $toId | The ID of the entity the redirect should point to. The Entity must exist and must not be a redirect. |
bool | $bot | Whether the edit should be marked as bot |
RedirectCreationException | If creating the redirect fails. Calling code may use RedirectCreationException::getErrorCode() to get further information about the cause of the failure. An explanation of the error codes can be obtained from getErrorCodeInfo(). |
|
private |
EntityRedirect | $redirect | |
FormatableSummary | $summary | |
bool | $bot | Whether the edit should be marked as bot |
RedirectCreationException |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |