Wikibase
MediaWiki Wikibase extension
|
A ChangeOp represents a modification of an entity. More...
Public Member Functions | |
getActions () | |
Returns a list of actions, defined as EntityPermissionChecker::ACTION_ constants, that the change op involves, so user permissions can be checked accordingly prior to validating and/or applying the change op. | |
validate (EntityDocument $entity) | |
Validates the current ChangeOp. | |
apply (EntityDocument $entity, Summary $summary=null) | |
Applies the change represented by this ChangeOp to the given Entity. | |
A ChangeOp represents a modification of an entity.
It is responsible for the actual modifications, as well as providing associated services such as building an appropriate edit summary and performing validation of the change.
Wikibase\Repo\ChangeOp\ChangeOp::apply | ( | EntityDocument | $entity, |
Summary | $summary = null ) |
Applies the change represented by this ChangeOp to the given Entity.
As ChangeOp
does not yet know whether it is going to change the entity or not, and since expensive validations should be run only on ChangeOp
s that will change the entity, ChangeOpResult::validate
is recommended for such validations.
EntityDocument | $entity | |
Summary | null | $summary |
InvalidArgumentException | when called with an unexpected entity type. |
ChangeOpException | when the change can not be applied to the entity, e.g. because the same data was edited in the meantime. |
Implemented in Wikibase\Repo\ChangeOp\ChangeOpAliases, Wikibase\Repo\ChangeOp\ChangeOpDescription, Wikibase\Repo\ChangeOp\ChangeOpFingerprint, Wikibase\Repo\ChangeOp\ChangeOpLabel, Wikibase\Repo\ChangeOp\ChangeOpMainSnak, Wikibase\Repo\ChangeOp\ChangeOpQualifier, Wikibase\Repo\ChangeOp\ChangeOpQualifierRemove, Wikibase\Repo\ChangeOp\ChangeOpReference, Wikibase\Repo\ChangeOp\ChangeOpReferenceRemove, Wikibase\Repo\ChangeOp\ChangeOpRemoveSiteLink, Wikibase\Repo\ChangeOp\ChangeOpRemoveStatement, Wikibase\Repo\ChangeOp\ChangeOps, Wikibase\Repo\ChangeOp\ChangeOpSiteLink, Wikibase\Repo\ChangeOp\ChangeOpStatement, Wikibase\Repo\ChangeOp\ChangeOpStatementRank, and Wikibase\Repo\ChangeOp\NullChangeOp.
Wikibase\Repo\ChangeOp\ChangeOp::getActions | ( | ) |
Returns a list of actions, defined as EntityPermissionChecker::ACTION_ constants, that the change op involves, so user permissions can be checked accordingly prior to validating and/or applying the change op.
Implemented in Wikibase\Repo\ChangeOp\ChangeOpAliases, Wikibase\Repo\ChangeOp\ChangeOpBase, Wikibase\Repo\ChangeOp\ChangeOpDescription, Wikibase\Repo\ChangeOp\ChangeOpFingerprint, Wikibase\Repo\ChangeOp\ChangeOpLabel, Wikibase\Repo\ChangeOp\ChangeOps, and Wikibase\Repo\ChangeOp\NullChangeOp.
Wikibase\Repo\ChangeOp\ChangeOp::validate | ( | EntityDocument | $entity | ) |
Validates the current ChangeOp.
This indicates whether this ChangeOp is valid with respect to the given entity.
EntityDocument | $entity |
InvalidArgumentException | when called with an unexpected entity type. |
ChangeOpException | when the change is invalid for this entity for other reasons than the entity type. |
Implemented in Wikibase\Repo\ChangeOp\ChangeOpAliases, Wikibase\Repo\ChangeOp\ChangeOpDescription, Wikibase\Repo\ChangeOp\ChangeOpFingerprint, Wikibase\Repo\ChangeOp\ChangeOpLabel, Wikibase\Repo\ChangeOp\ChangeOpMainSnak, Wikibase\Repo\ChangeOp\ChangeOpQualifier, Wikibase\Repo\ChangeOp\ChangeOpQualifierRemove, Wikibase\Repo\ChangeOp\ChangeOpReference, Wikibase\Repo\ChangeOp\ChangeOpReferenceRemove, Wikibase\Repo\ChangeOp\ChangeOpRemoveSiteLink, Wikibase\Repo\ChangeOp\ChangeOpRemoveStatement, Wikibase\Repo\ChangeOp\ChangeOps, Wikibase\Repo\ChangeOp\ChangeOpSiteLink, Wikibase\Repo\ChangeOp\ChangeOpStatement, Wikibase\Repo\ChangeOp\ChangeOpStatementRank, and Wikibase\Repo\ChangeOp\NullChangeOp.