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

Class for reference change operation. More...

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

Public Member Functions

 __construct ( $statementGuid, Reference $reference, $referenceHash, SnakValidator $snakValidator, $index=null)
 Constructs a new reference change operation.
 
 apply (EntityDocument $entity, Summary $summary=null)
 
 validate (EntityDocument $entity)
 
- Public Member Functions inherited from Wikibase\Repo\ChangeOp\ChangeOpBase
 getActions ()
 

Protected Member Functions

 addReference (ReferenceList $references, Summary $summary=null)
 
 setReference (ReferenceList $references, Summary $summary=null)
 
 getSnakSummaryArgs (Snak $snak)
 
- Protected Member Functions inherited from Wikibase\Repo\ChangeOp\ChangeOpBase
 updateSummary (?Summary $summary, $action, $language='', $args='')
 

Private Attributes

 $statementGuid
 
 $reference
 
 $referenceHash
 
 $index
 
 $snakValidator
 

Detailed Description

Class for reference change operation.

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 >
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\ChangeOp\ChangeOpReference::__construct ( $statementGuid,
Reference $reference,
$referenceHash,
SnakValidator $snakValidator,
$index = null )

Constructs a new reference change operation.

Parameters
string$statementGuid
Reference$reference
string$referenceHash(if empty '' a new reference will be created)
SnakValidator$snakValidator
int | null$index
Exceptions
InvalidArgumentException

Member Function Documentation

◆ addReference()

Wikibase\Repo\ChangeOp\ChangeOpReference::addReference ( ReferenceList $references,
Summary $summary = null )
protected
Parameters
ReferenceList$references
Summary | null$summary
Exceptions
ChangeOpException

◆ apply()

Wikibase\Repo\ChangeOp\ChangeOpReference::apply ( EntityDocument $entity,
Summary $summary = null )
See also
ChangeOp::apply()
  • a new reference gets added when $referenceHash is empty and $reference is set
  • the reference gets set to $reference when $referenceHash and $reference are set
Parameters
EntityDocument$entity
Summary | null$summary
Exceptions
InvalidArgumentException
ChangeOpException

Implements Wikibase\Repo\ChangeOp\ChangeOp.

◆ getSnakSummaryArgs()

Wikibase\Repo\ChangeOp\ChangeOpReference::getSnakSummaryArgs ( Snak $snak)
protected
Parameters
Snak$snak
Returns
array

◆ setReference()

Wikibase\Repo\ChangeOp\ChangeOpReference::setReference ( ReferenceList $references,
Summary $summary = null )
protected
Parameters
ReferenceList$references
Summary | null$summary
Exceptions
ChangeOpException

◆ validate()

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

Implements Wikibase\Repo\ChangeOp\ChangeOp.

Member Data Documentation

◆ $index

Wikibase\Repo\ChangeOp\ChangeOpReference::$index
private

◆ $reference

Wikibase\Repo\ChangeOp\ChangeOpReference::$reference
private

◆ $referenceHash

Wikibase\Repo\ChangeOp\ChangeOpReference::$referenceHash
private

◆ $snakValidator

Wikibase\Repo\ChangeOp\ChangeOpReference::$snakValidator
private

◆ $statementGuid

Wikibase\Repo\ChangeOp\ChangeOpReference::$statementGuid
private

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