|
Wikibase
MediaWiki Wikibase extension
|
Helper class for modifying an entities statements. More...
Public Member Functions | |
| __construct (SnakFactory $snakFactory, EntityIdParser $entityIdParser, StatementGuidValidator $guidValidator, ApiErrorReporter $errorReporter) | |
| validateStatementGuid ( $guid) | |
| getStatementFromEntity ( $guid, EntityDocument $entity) | |
| getSnakInstance (array $params, PropertyId $propertyId) | |
| createSummary (array $params, ApiBase $module) | |
| Creates a new Summary instance suitable for representing the action performed by this module. | |
| applyChangeOp (ChangeOp $changeOp, EntityDocument $entity, ?Summary $summary=null) | |
| Applies the given ChangeOp to the given Entity. | |
Private Attributes | |
| $snakFactory | |
| $entityIdParser | |
| $guidValidator | |
| $errorReporter | |
Helper class for modifying an entities statements.
| Wikibase\Repo\Api\StatementModificationHelper::__construct | ( | SnakFactory | $snakFactory, |
| EntityIdParser | $entityIdParser, | ||
| StatementGuidValidator | $guidValidator, | ||
| ApiErrorReporter | $errorReporter ) |
| Wikibase\Repo\Api\StatementModificationHelper::applyChangeOp | ( | ChangeOp | $changeOp, |
| EntityDocument | $entity, | ||
| ?Summary | $summary = null ) |
Applies the given ChangeOp to the given Entity.
Any ChangeOpException is converted into an ApiUsageException with the code 'modification-failed'.
| ChangeOp | $changeOp | |
| EntityDocument | $entity | |
| Summary | null | $summary | The summary object to update with information about the change. |
| Wikibase\Repo\Api\StatementModificationHelper::createSummary | ( | array | $params, |
| ApiBase | $module ) |
Creates a new Summary instance suitable for representing the action performed by this module.
| array | $params | |
| ApiBase | $module |
| Wikibase\Repo\Api\StatementModificationHelper::getSnakInstance | ( | array | $params, |
| PropertyId | $propertyId ) |
| string[] | $params | Array with a 'snaktype' and an optional 'value' element. |
| PropertyId | $propertyId |
| ApiUsageException | |
| LogicException |
| Wikibase\Repo\Api\StatementModificationHelper::getStatementFromEntity | ( | $guid, | |
| EntityDocument | $entity ) |
| string | $guid | |
| EntityDocument | $entity |
| ApiUsageException |
| Wikibase\Repo\Api\StatementModificationHelper::validateStatementGuid | ( | $guid | ) |
| string | $guid |
|
private |
|
private |
|
private |
|
private |