Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Lib\Changes\EntityDiffChangedAspects Class Reference

This class holds a very compact and simple representation of an Entity diff for propagating repo changes to clients (T113468). More...

+ Inheritance diagram for Wikibase\Lib\Changes\EntityDiffChangedAspects:
+ Collaboration diagram for Wikibase\Lib\Changes\EntityDiffChangedAspects:

Public Member Functions

 __construct (array $labelChanges, array $descriptionChanges, array $statementChanges, array $siteLinkChanges, $otherChanges)
 Note: If an entity doesn't have a certain aspect, just report that no changes happened (empty array).
 
 getLabelChanges ()
 Language codes of the labels that changed (added, removed or updated)
 
 getDescriptionChanges ()
 Language codes of the descriptions that changed (added, removed or updated)
 
 getStatementChanges ()
 Property id serialization from the statements that changed (added, removed or updated)
 
 getSiteLinkChanges ()
 Map of site ids to array of old value, new value and boolean value determining if badge has changed or not.
 
 hasOtherChanges ()
 Do we have changes that are not covered more specifically?
 
 serialize ()
 
 __serialize ()
 
 unserialize ( $serialized)
 
 __unserialize (array $data)
 
 toArray ()
 

Public Attributes

const ARRAYFORMATVERSION = 1
 Increases whenever the array format (self::toArray) changes.
 

Private Attributes

 $labelChanges
 
 $descriptionChanges
 
 $statementChanges
 
 $siteLinkChanges
 
 $otherChanges
 

Detailed Description

This class holds a very compact and simple representation of an Entity diff for propagating repo changes to clients (T113468).

This can also be used for entity types which don't have all aspects mentioned here, the aspects are represented as unchanged in that case.

Author
Marius Hoch

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Changes\EntityDiffChangedAspects::__construct ( array $labelChanges,
array $descriptionChanges,
array $statementChanges,
array $siteLinkChanges,
$otherChanges )

Note: If an entity doesn't have a certain aspect, just report that no changes happened (empty array).

Parameters
string[]$labelChangesLanguage codes of the labels that changed (added, removed or updated)
string[]$descriptionChangesLanguage codes of the descriptions that changed (added, removed or updated)
string[]$statementChangesProperty id serialization from the statements that changed (added, removed or updated)
array[]$siteLinkChangesMap of global site identifiers to [ string|null $oldPageName, string|null $newPageName, bool $badgesChanged ]
bool$otherChangesDo we have changes that are not covered more specifically?

Member Function Documentation

◆ __serialize()

Wikibase\Lib\Changes\EntityDiffChangedAspects::__serialize ( )

◆ __unserialize()

Wikibase\Lib\Changes\EntityDiffChangedAspects::__unserialize ( array $data)

◆ getDescriptionChanges()

Wikibase\Lib\Changes\EntityDiffChangedAspects::getDescriptionChanges ( )

Language codes of the descriptions that changed (added, removed or updated)

Returns
string[]

◆ getLabelChanges()

Wikibase\Lib\Changes\EntityDiffChangedAspects::getLabelChanges ( )

Language codes of the labels that changed (added, removed or updated)

Returns
string[]

◆ getSiteLinkChanges()

Wikibase\Lib\Changes\EntityDiffChangedAspects::getSiteLinkChanges ( )

Map of site ids to array of old value, new value and boolean value determining if badge has changed or not.

Returns
array[]

◆ getStatementChanges()

Wikibase\Lib\Changes\EntityDiffChangedAspects::getStatementChanges ( )

Property id serialization from the statements that changed (added, removed or updated)

Returns
string[]

◆ hasOtherChanges()

Wikibase\Lib\Changes\EntityDiffChangedAspects::hasOtherChanges ( )

Do we have changes that are not covered more specifically?

Returns
bool

◆ serialize()

Wikibase\Lib\Changes\EntityDiffChangedAspects::serialize ( )
See also
Serializable::serialize
Returns
string JSON

◆ toArray()

Wikibase\Lib\Changes\EntityDiffChangedAspects::toArray ( )
Returns
array

◆ unserialize()

Wikibase\Lib\Changes\EntityDiffChangedAspects::unserialize ( $serialized)
See also
Serializable::unserialize
Parameters
string$serializedJSON
Exceptions
Exception

Member Data Documentation

◆ $descriptionChanges

Wikibase\Lib\Changes\EntityDiffChangedAspects::$descriptionChanges
private

◆ $labelChanges

Wikibase\Lib\Changes\EntityDiffChangedAspects::$labelChanges
private

◆ $otherChanges

Wikibase\Lib\Changes\EntityDiffChangedAspects::$otherChanges
private

◆ $siteLinkChanges

Wikibase\Lib\Changes\EntityDiffChangedAspects::$siteLinkChanges
private

◆ $statementChanges

Wikibase\Lib\Changes\EntityDiffChangedAspects::$statementChanges
private

◆ ARRAYFORMATVERSION

const Wikibase\Lib\Changes\EntityDiffChangedAspects::ARRAYFORMATVERSION = 1

Increases whenever the array format (self::toArray) changes.


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