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

Holds only generic info on whether entity was changed or not. More...

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

Public Member Functions

 __construct (?EntityId $entityId, bool $isEntityChanged)
 
 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...
 

Private Attributes

 $entityId
 
 $isEntityChanged
 

Detailed Description

Holds only generic info on whether entity was changed or not.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\ChangeOp\GenericChangeOpResult::__construct ( ?EntityId  $entityId,
bool  $isEntityChanged 
)

Member Function Documentation

◆ getEntityId()

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

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

Returns
EntityId|null

Implements Wikibase\Repo\ChangeOp\ChangeOpResult.

◆ isEntityChanged()

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

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

Returns
bool

Implements Wikibase\Repo\ChangeOp\ChangeOpResult.

◆ validate()

Wikibase\Repo\ChangeOp\GenericChangeOpResult::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

Implements Wikibase\Repo\ChangeOp\ChangeOpResult.

Member Data Documentation

◆ $entityId

Wikibase\Repo\ChangeOp\GenericChangeOpResult::$entityId
private

◆ $isEntityChanged

Wikibase\Repo\ChangeOp\GenericChangeOpResult::$isEntityChanged
private

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