Wikibase
MediaWiki Wikibase extension
|
Class for statement modification operations. More...
Public Member Functions | |||||||||||
__construct (Statement $statement, GuidGenerator $guidGenerator, StatementGuidValidator $guidValidator, StatementGuidParser $guidParser, SnakValidator $snakValidator, $index=null) | |||||||||||
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.
| |||||||||||
validate (EntityDocument $entity) | |||||||||||
Public Member Functions inherited from Wikibase\Repo\ChangeOp\ChangeOpBase | |||||||||||
getActions () | |||||||||||
Private Member Functions | |
validateStatementGuid (EntityId $entityId) | |
removeStatement (StatementList $statements) | |
checkMainSnakUpdate (Statement $oldStatement) | |
Checks that the update of the main snak is permissible. | |
addStatementToGroup (StatementList $statements, $index) | |
Private Attributes | |
$statement | |
$guidGenerator | |
$guidValidator | |
$guidParser | |
$snakValidator | |
$index | |
Additional Inherited Members | |
Protected Member Functions inherited from Wikibase\Repo\ChangeOp\ChangeOpBase | |
updateSummary (?Summary $summary, $action, $language='', $args='') | |
Class for statement modification operations.
Wikibase\Repo\ChangeOp\ChangeOpStatement::__construct | ( | Statement | $statement, |
GuidGenerator | $guidGenerator, | ||
StatementGuidValidator | $guidValidator, | ||
StatementGuidParser | $guidParser, | ||
SnakValidator | $snakValidator, | ||
$index = null ) |
Statement | $statement | |
GuidGenerator | $guidGenerator | |
StatementGuidValidator | $guidValidator | |
StatementGuidParser | $guidParser | |
SnakValidator | $snakValidator | |
int | null | $index | Where the statement should be placed among the other statements. |
InvalidArgumentException |
|
private |
StatementList | $statements | |
int | $index |
Wikibase\Repo\ChangeOp\ChangeOpStatement::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. |
Implements Wikibase\Repo\ChangeOp\ChangeOp.
|
private |
Checks that the update of the main snak is permissible.
This checks that the main snaks of the old and the new statement refer to the same property.
Statement | $oldStatement |
ChangeOpException | If the main snak update is illegal. |
|
private |
StatementList | $statements |
Wikibase\Repo\ChangeOp\ChangeOpStatement::validate | ( | EntityDocument | $entity | ) |
EntityDocument | $entity |
Implements Wikibase\Repo\ChangeOp\ChangeOp.
|
private |
EntityId | $entityId |
ChangeOpException |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |