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, EditFilterHookRunner $editFilterHookRunner, EntityRedirectTargetLookup $entityRedirectLookup, EntityTitleStoreLookup $entityTitleLookup) | |
createRedirect (EntityId $fromId, EntityId $toId, bool $bot, array $tags, IContextSource $context) | |
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, IContextSource $context) | |
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, IContextSource $context, bool $bot, array $tags) | |
Private Attributes | |
$entityTitleLookup | |
$entityRevisionLookup | |
$entityStore | |
$permissionChecker | |
$summaryFormatter | |
$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, | ||
EditFilterHookRunner | $editFilterHookRunner, | ||
EntityRedirectTargetLookup | $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 | |
IContextSource | $context |
RedirectCreationException | if the permission check fails |
|
private |
Wikibase\Repo\Interactors\EntityRedirectCreationInteractor::createRedirect | ( | EntityId | $fromId, |
EntityId | $toId, | ||
bool | $bot, | ||
array | $tags, | ||
IContextSource | $context | ||
) |
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 |
string[] | $tags | |
IContextSource | null | $context | The context to pass to the edit filter hook and check permissions |
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(). PhanTypeMismatchDeclaredParam |
|
private |
RedirectCreationException |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |