Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\ChangeOp\ChangeOpFingerprint Class Reference

Decorator on ChangeOps for collecting and distinguishing a collection of ChangeOp instances on entity fingerprint parts. More...

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

Public Member Functions

 __construct (ChangeOps $innerChangeOps, TermValidatorFactory $termValidatorFactory)
 
 add ( $changeOps)
 Adds one change operation or a list of change operations.
 
 getChangeOps ()
 Get the array of change operations.
 
 validate (EntityDocument $entity)
 
 getActions ()
 
 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 ChangeOps that will change the entity, ChangeOpResult::validate is recommended for such validations.
Parameters
EntityDocument$entity
Summary | null$summary
Exceptions
InvalidArgumentExceptionwhen called with an unexpected entity type.
ChangeOpExceptionwhen the change can not be applied to the entity, e.g. because the same data was edited in the meantime.
Returns
ChangeOpResult

 
- Public Member Functions inherited from Wikibase\Repo\ChangeOp\ChangeOps
 __construct ( $changeOps=[])
 

Private Attributes

 $innerChangeOps
 
 $termValidatorFactory
 

Detailed Description

Decorator on ChangeOps for collecting and distinguishing a collection of ChangeOp instances on entity fingerprint parts.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\ChangeOp\ChangeOpFingerprint::__construct ( ChangeOps $innerChangeOps,
TermValidatorFactory $termValidatorFactory )

Member Function Documentation

◆ add()

Wikibase\Repo\ChangeOp\ChangeOpFingerprint::add ( $changeOps)

Adds one change operation or a list of change operations.

Parameters
ChangeOp | ChangeOp[]$changeOps
Exceptions
InvalidArgumentException

Reimplemented from Wikibase\Repo\ChangeOp\ChangeOps.

◆ apply()

Wikibase\Repo\ChangeOp\ChangeOpFingerprint::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 ChangeOps that will change the entity, ChangeOpResult::validate is recommended for such validations.

Parameters
EntityDocument$entity
Summary | null$summary
Exceptions
InvalidArgumentExceptionwhen called with an unexpected entity type.
ChangeOpExceptionwhen the change can not be applied to the entity, e.g. because the same data was edited in the meantime.
Returns
ChangeOpResult

Reimplemented from Wikibase\Repo\ChangeOp\ChangeOps.

◆ getActions()

Wikibase\Repo\ChangeOp\ChangeOpFingerprint::getActions ( )
See also
ChangeOp::getActions
Returns
string[]

Reimplemented from Wikibase\Repo\ChangeOp\ChangeOps.

◆ getChangeOps()

Wikibase\Repo\ChangeOp\ChangeOpFingerprint::getChangeOps ( )

Get the array of change operations.

Returns
ChangeOp[]

Reimplemented from Wikibase\Repo\ChangeOp\ChangeOps.

◆ validate()

Wikibase\Repo\ChangeOp\ChangeOpFingerprint::validate ( EntityDocument $entity)
See also
ChangeOp::validate()
Parameters
EntityDocument$entity
Exceptions
ChangeOpException
Returns
Result

Reimplemented from Wikibase\Repo\ChangeOp\ChangeOps.

Member Data Documentation

◆ $innerChangeOps

Wikibase\Repo\ChangeOp\ChangeOpFingerprint::$innerChangeOps
private

◆ $termValidatorFactory

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

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