Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\DataModel\Services\Diff\EntityDiff Class Reference

Represents a diff between two entities. More...

+ Inheritance diagram for Wikibase\DataModel\Services\Diff\EntityDiff:
+ Collaboration diagram for Wikibase\DataModel\Services\Diff\EntityDiff:

Public Member Functions

 __construct (array $operations=[])
 
 getAliasesDiff ()
 FIXME: Not all entities do have aliases!
 
 getLabelsDiff ()
 FIXME: Not all entities do have labels!
 
 getDescriptionsDiff ()
 FIXME: Not all entities do have descriptions!
 
 getClaimsDiff ()
 FIXME: Not all entities do have claims a.k.a.
 
 isEmpty ()
 Returns if there are any changes (equivalent to: any differences between the entities).
 
 getType ()
 

Static Public Member Functions

static newForType ( $entityType, array $operations=[])
 

Protected Member Functions

 fixSubstructureDiff (array &$operations, $key)
 Checks the type of a substructure diff, and replaces it if needed.
 

Detailed Description

Represents a diff between two entities.

Since
1.0
Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >

Constructor & Destructor Documentation

◆ __construct()

Wikibase\DataModel\Services\Diff\EntityDiff::__construct ( array $operations = [])
Parameters
DiffOp[]$operations

Reimplemented in Wikibase\DataModel\Services\Diff\ItemDiff.

Member Function Documentation

◆ fixSubstructureDiff()

Wikibase\DataModel\Services\Diff\EntityDiff::fixSubstructureDiff ( array & $operations,
$key )
protected

Checks the type of a substructure diff, and replaces it if needed.

This is needed for backwards compatibility with old versions of MapDiffer: As of commit ff65735a125e, MapDiffer may generate atomic diffs for substructures even in recursive mode (bug 51363).

Parameters
array&$operationsAll change ops; This is a reference, so the substructure diff can be replaced if need be.
string$keyThe key of the substructure

◆ getAliasesDiff()

Wikibase\DataModel\Services\Diff\EntityDiff::getAliasesDiff ( )

FIXME: Not all entities do have aliases!

Returns a Diff object with the aliases differences.

Returns
Diff

◆ getClaimsDiff()

Wikibase\DataModel\Services\Diff\EntityDiff::getClaimsDiff ( )

FIXME: Not all entities do have claims a.k.a.

statements!

Returns a Diff object with the claim differences.

Returns
Diff

◆ getDescriptionsDiff()

Wikibase\DataModel\Services\Diff\EntityDiff::getDescriptionsDiff ( )

FIXME: Not all entities do have descriptions!

Returns a Diff object with the descriptions differences.

Returns
Diff

◆ getLabelsDiff()

Wikibase\DataModel\Services\Diff\EntityDiff::getLabelsDiff ( )

FIXME: Not all entities do have labels!

Returns a Diff object with the labels differences.

Returns
Diff

◆ getType()

Wikibase\DataModel\Services\Diff\EntityDiff::getType ( )
See also
DiffOp::getType
Returns
string

Reimplemented in Wikibase\DataModel\Services\Diff\ItemDiff.

◆ isEmpty()

Wikibase\DataModel\Services\Diff\EntityDiff::isEmpty ( )

Returns if there are any changes (equivalent to: any differences between the entities).

Returns
bool

Reimplemented in Wikibase\DataModel\Services\Diff\ItemDiff.

◆ newForType()

static Wikibase\DataModel\Services\Diff\EntityDiff::newForType ( $entityType,
array $operations = [] )
static
Parameters
string$entityType
DiffOp[]$operations
Returns
self

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