Abstract special page for modifying Wikibase entity.
More...
|
| __construct ( $title, SpecialPageCopyrightView $copyrightView, SummaryFormatter $summaryFormatter, EntityTitleLookup $entityTitleLookup, MediawikiEditEntityFactory $editEntityFactory) |
|
| doesWrites () |
|
| execute ( $subPage) |
|
| __construct ( $title, $restriction, SpecialPageCopyrightView $copyrightView, SummaryFormatter $summaryFormatter, EntityTitleLookup $entityTitleLookup, MediawikiEditEntityFactory $editEntityFactory) |
|
| __construct ( $name='', $restriction='', $listed=true) |
|
| getDescription () |
|
| setHeaders () |
|
|
| handleStatus (Status $status, EntityDocument $entity) |
|
| setForm (EntityDocument $entity=null) |
| Building the HTML form for modifying an entity. More...
|
|
Abstract special page for modifying Wikibase entity.
- Copyright
- GPL-2.0-or-later
- Author
- Bene* < benes.nosp@m.tar..nosp@m.wikim.nosp@m.edia.nosp@m.@goog.nosp@m.lema.nosp@m.il.co.nosp@m.m >
-
Daniel Kinzler
◆ __construct()
◆ applyChangeOp()
Wikibase\Repo\Specials\SpecialModifyEntity::applyChangeOp |
( |
ChangeOp |
$changeOp, |
|
|
EntityDocument |
$entity, |
|
|
Summary |
$summary = null |
|
) |
| |
|
protected |
Applies the given ChangeOp to the given Entity.
If validation fails, a ChangeOpValidationException is thrown.
- Parameters
-
ChangeOp | $changeOp | |
EntityDocument | $entity | |
Summary | null | $summary | The summary object to update with information about the change. |
- Exceptions
-
◆ doesWrites()
Wikibase\Repo\Specials\SpecialModifyEntity::doesWrites |
( |
| ) |
|
◆ execute()
Wikibase\Repo\Specials\SpecialModifyEntity::execute |
( |
|
$subPage | ) |
|
◆ getBaseRevision()
Wikibase\Repo\Specials\SpecialModifyEntity::getBaseRevision |
( |
| ) |
|
|
protected |
Returns the base revision.
If no base revision ID was passed to prepareEditEntity(), this returns the latest revision.
- Exceptions
-
- Returns
- EntityRevision
◆ getEntityForDisplay()
Wikibase\Repo\Specials\SpecialModifyEntity::getEntityForDisplay |
( |
| ) |
|
|
protected |
Returns the EntityDocument that is to be shown by code in this class (or subclasses).
The returns null if no entity ID was specified in the request.
- Exceptions
-
MessageException | |
UserInputException | |
- Returns
- EntityDocument|null
◆ getEntityForModification()
Wikibase\Repo\Specials\SpecialModifyEntity::getEntityForModification |
( |
| ) |
|
|
protected |
Returns the EntityDocument that is to be modified by code in this class (or subclasses).
The first call to this method calls getBaseRevision().
- Exceptions
-
MessageException | |
UserInputException | |
- Returns
- EntityDocument
◆ getEntityId()
Wikibase\Repo\Specials\SpecialModifyEntity::getEntityId |
( |
| ) |
|
|
protected |
Returns the ID of the Entity being modified.
Returns null if no entity ID was specified in the request.
- Note
- The return value is undefined before prepareArguments() has been called.
- Returns
- null|EntityId
◆ getForm()
Wikibase\Repo\Specials\SpecialModifyEntity::getForm |
( |
EntityDocument |
$entity = null | ) |
|
|
abstractprotected |
◆ getFormElements()
Wikibase\Repo\Specials\SpecialModifyEntity::getFormElements |
( |
EntityDocument |
$entity = null | ) |
|
|
protected |
- Parameters
-
EntityDocument | null | $entity | |
- Returns
- array
◆ getLatestRevision()
Wikibase\Repo\Specials\SpecialModifyEntity::getLatestRevision |
( |
| ) |
|
|
protected |
Returns the current revision.
- Exceptions
-
- Returns
- null|EntityRevision
◆ handleStatus()
Wikibase\Repo\Specials\SpecialModifyEntity::handleStatus |
( |
Status |
$status, |
|
|
EntityDocument |
$entity |
|
) |
| |
|
private |
◆ isModificationRequested()
Wikibase\Repo\Specials\SpecialModifyEntity::isModificationRequested |
( |
| ) |
|
|
protected |
Whether the current request is a request for modification (as opposed to a request for showing the input form).
If this method returns false, the entity should not be updated and the user should be presented with an input form. Only if it returns true, and validateInput() also returns true, the entity should be updated in the storage backend.
Undefined before processArguments() was called.
- Returns
- bool
◆ modifyEntity()
Wikibase\Repo\Specials\SpecialModifyEntity::modifyEntity |
( |
EntityDocument |
$entity | ) |
|
|
abstractprotected |
◆ processArguments()
Wikibase\Repo\Specials\SpecialModifyEntity::processArguments |
( |
|
$subPage | ) |
|
|
protected |
◆ setForm()
Wikibase\Repo\Specials\SpecialModifyEntity::setForm |
( |
EntityDocument |
$entity = null | ) |
|
|
private |
Building the HTML form for modifying an entity.
- Parameters
-
EntityDocument | null | $entity | |
◆ validateInput()
Wikibase\Repo\Specials\SpecialModifyEntity::validateInput |
( |
| ) |
|
|
protected |
Validates form input.
The default implementation does nothing. Subclasses should override this to detect otherwise incomplete or erroneous input.
If this method returns false, the entity should not be updated and the user should be presented with an input form. Only if it returns true, and isModificationRequested() also returns true, the entity should be updated in the storage backend.
- Exceptions
-
UserInputException | if any of the provided input is invalid. If the input is merely incomplete, no exception should be raised. |
- Returns
- bool true if all input needed for modification has been supplied. false if the input is valid but incomplete, or if the input is invalid and showErrorHTML() has already been called to notify the user of the problem. The preferred way of indicating invalid input is however to throw a UserInputException.
Reimplemented in Wikibase\Repo\Specials\SpecialSetSiteLink, Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases, Wikibase\Repo\Specials\SpecialSetLabel, Wikibase\Repo\Specials\SpecialSetDescription, Wikibase\Repo\Specials\SpecialSetAliases, and Wikibase\Repo\Specials\SpecialModifyTerm.
◆ $entityForModification
Wikibase\Repo\Specials\SpecialModifyEntity::$entityForModification = null |
|
private |
◆ $entityId
Wikibase\Repo\Specials\SpecialModifyEntity::$entityId |
|
private |
The documentation for this class was generated from the following file: