Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\ChangeOp\ChangeOpFingerprintResult Class Reference

Decorator on ChangeOpsResult for collecting and distinguishing a collection of ChangeOpResult instances on entity fingerprint parts. More...

+ Inheritance diagram for Wikibase\Repo\ChangeOp\ChangeOpFingerprintResult:
+ Collaboration diagram for Wikibase\Repo\ChangeOp\ChangeOpFingerprintResult:

Public Member Functions

 __construct (ChangeOpsResult $changeOpsResult, TermValidatorFactory $termValidatorFactory)
 
 getChangeOpsResults ()
 
 getEntityId ()
 The id of the entity document that the change op was applied to. More...
 
 isEntityChanged ()
 Whether the entity document was actually changed in any way as a result of applying the change op to it. More...
 
 validate ()
 Validate a ChangeOpResult. More...
 
- Public Member Functions inherited from Wikibase\Repo\ChangeOp\ChangeOpsResult
 __construct (EntityId $entityId=null, array $changeOpResults=[])
 

Private Attributes

 $innerChangeOpsResult
 
 $termValidatorFactory
 

Detailed Description

Decorator on ChangeOpsResult for collecting and distinguishing a collection of ChangeOpResult instances on entity fingerprint parts.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\ChangeOp\ChangeOpFingerprintResult::__construct ( ChangeOpsResult  $changeOpsResult,
TermValidatorFactory  $termValidatorFactory 
)

Member Function Documentation

◆ getChangeOpsResults()

Wikibase\Repo\ChangeOp\ChangeOpFingerprintResult::getChangeOpsResults ( )

◆ getEntityId()

Wikibase\Repo\ChangeOp\ChangeOpFingerprintResult::getEntityId ( )

The id of the entity document that the change op was applied to.

Returns
EntityId|null

Reimplemented from Wikibase\Repo\ChangeOp\ChangeOpsResult.

◆ isEntityChanged()

Wikibase\Repo\ChangeOp\ChangeOpFingerprintResult::isEntityChanged ( )

Whether the entity document was actually changed in any way as a result of applying the change op to it.

Returns
bool

Reimplemented from Wikibase\Repo\ChangeOp\ChangeOpsResult.

◆ validate()

Wikibase\Repo\ChangeOp\ChangeOpFingerprintResult::validate ( )

Validate a ChangeOpResult.

Mostly suitable for validations that need to run only on the parts that have been actually changed on an entity. Example of those are expensive validations that need to run on db or other external slower types of stores.

For simpler and less-expensive validations, ChangeOp::validate can be used as well.

Concrete example: Checking for uniqueness of terms (fingerprint) across the store is an expensive operation. It better be checked only on terms that are actually going to change on entity, rather than validate uniqueness on all terms including the ones that are not changed.

Returns
Result

Reimplemented from Wikibase\Repo\ChangeOp\ChangeOpsResult.

Member Data Documentation

◆ $innerChangeOpsResult

Wikibase\Repo\ChangeOp\ChangeOpFingerprintResult::$innerChangeOpsResult
private

◆ $termValidatorFactory

Wikibase\Repo\ChangeOp\ChangeOpFingerprintResult::$termValidatorFactory
private

The documentation for this class was generated from the following file: