Helper class for modifying an entities statements.
More...
Helper class for modifying an entities statements.
- Copyright
- GPL-2.0-or-later
◆ __construct()
Wikibase\Repo\Api\StatementModificationHelper::__construct |
( |
SnakFactory |
$snakFactory, |
|
|
EntityIdParser |
$entityIdParser, |
|
|
StatementGuidValidator |
$guidValidator, |
|
|
ApiErrorReporter |
$errorReporter |
|
) |
| |
◆ applyChangeOp()
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'.
- Parameters
-
ChangeOp | $changeOp | |
EntityDocument | $entity | |
Summary | null | $summary | The summary object to update with information about the change. |
◆ createSummary()
Wikibase\Repo\Api\StatementModificationHelper::createSummary |
( |
array |
$params, |
|
|
ApiBase |
$module |
|
) |
| |
Creates a new Summary instance suitable for representing the action performed by this module.
- Parameters
-
array | $params | |
ApiBase | $module | |
- Returns
- Summary
◆ getSnakInstance()
Wikibase\Repo\Api\StatementModificationHelper::getSnakInstance |
( |
array |
$params, |
|
|
PropertyId |
$propertyId |
|
) |
| |
- Parameters
-
string[] | $params | Array with a 'snaktype' and an optional 'value' element. |
PropertyId | $propertyId | |
- Exceptions
-
ApiUsageException | |
LogicException | |
- Returns
- Snak
◆ getStatementFromEntity()
Wikibase\Repo\Api\StatementModificationHelper::getStatementFromEntity |
( |
|
$guid, |
|
|
EntityDocument |
$entity |
|
) |
| |
- Parameters
-
string | $guid | |
EntityDocument | $entity | |
- Exceptions
-
- Returns
- Statement
◆ validateStatementGuid()
Wikibase\Repo\Api\StatementModificationHelper::validateStatementGuid |
( |
|
$guid | ) |
|
◆ $entityIdParser
Wikibase\Repo\Api\StatementModificationHelper::$entityIdParser |
|
private |
◆ $errorReporter
Wikibase\Repo\Api\StatementModificationHelper::$errorReporter |
|
private |
◆ $guidValidator
Wikibase\Repo\Api\StatementModificationHelper::$guidValidator |
|
private |
◆ $snakFactory
Wikibase\Repo\Api\StatementModificationHelper::$snakFactory |
|
private |
The documentation for this class was generated from the following file: