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

Class for holding a batch of change operations. More...

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

Public Member Functions

 __construct ( $changeOps=[])
 
 add ( $changeOps)
 Adds one change operation or a list of change operations.
 
 getChangeOps ()
 Get the array of change operations.
 
 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

 
 validate (EntityDocument $entity)
 
 getActions ()
 

Private Attributes

 $changeOps = []
 

Detailed Description

Class for holding a batch of change operations.

Author
Tobias Gritschacher < tobia.nosp@m.s.gr.nosp@m.itsch.nosp@m.ache.nosp@m.r@wik.nosp@m.imed.nosp@m.ia.de >
Thiemo Kreuz

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\ChangeOp\ChangeOps::__construct ( $changeOps = [])
Parameters
ChangeOp | ChangeOp[]$changeOps
Exceptions
InvalidArgumentException

Member Function Documentation

◆ add()

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

Adds one change operation or a list of change operations.

Parameters
ChangeOp | ChangeOp[]$changeOps
Exceptions
InvalidArgumentException

Reimplemented in Wikibase\Repo\ChangeOp\ChangeOpFingerprint.

◆ apply()

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

Implements Wikibase\Repo\ChangeOp\ChangeOp.

Reimplemented in Wikibase\Repo\ChangeOp\ChangeOpFingerprint.

◆ getActions()

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

Implements Wikibase\Repo\ChangeOp\ChangeOp.

Reimplemented in Wikibase\Repo\ChangeOp\ChangeOpFingerprint.

◆ getChangeOps()

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

Get the array of change operations.

Returns
ChangeOp[]

Reimplemented in Wikibase\Repo\ChangeOp\ChangeOpFingerprint.

◆ validate()

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

Implements Wikibase\Repo\ChangeOp\ChangeOp.

Reimplemented in Wikibase\Repo\ChangeOp\ChangeOpFingerprint.

Member Data Documentation

◆ $changeOps

Wikibase\Repo\ChangeOp\ChangeOps::$changeOps = []
private

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