Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\Notifications\ChangeNotifier Class Reference

Class for generating and submitting change notifications in different situations. More...

Public Member Functions

 __construct (EntityChangeFactory $changeFactory, array $changeTransmitters, ?CentralIdLookup $centralIdLookup)
 
 notifyOnPageModified (RevisionRecord $current, RevisionRecord $parent)
 This method constructs and sends the appropriate notifications (if any) when a wiki page containing an EntityContent was modified. More...
 

Private Member Functions

 getCentralUserId (User $user)
 
 transmitChange (EntityChange $change)
 Transmit changes via all registered transmitters. More...
 

Private Attributes

 $changeFactory
 
 $changeTransmitters
 
 $centralIdLookup
 

Detailed Description

Class for generating and submitting change notifications in different situations.

This is a helper intended for use in hook handler functions.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Notifications\ChangeNotifier::__construct ( EntityChangeFactory  $changeFactory,
array  $changeTransmitters,
?CentralIdLookup  $centralIdLookup 
)
Parameters
EntityChangeFactory$changeFactory
ChangeTransmitter[]$changeTransmitters
CentralIdLookup | null$centralIdLookupCentralIdLookup, or null if this repository is not connected to a central user system, see CentralIdLookup::factoryNonLocal.

Member Function Documentation

◆ getCentralUserId()

Wikibase\Repo\Notifications\ChangeNotifier::getCentralUserId ( User  $user)
private
Parameters
User$userRepository user
Returns
int Central user ID, or 0

◆ notifyOnPageModified()

Wikibase\Repo\Notifications\ChangeNotifier::notifyOnPageModified ( RevisionRecord  $current,
RevisionRecord  $parent 
)

This method constructs and sends the appropriate notifications (if any) when a wiki page containing an EntityContent was modified.

Parameters
RevisionRecord$current
RevisionRecord$parent
Exceptions
InvalidArgumentException
ChangeTransmitterException
Returns
EntityChange|null

◆ transmitChange()

Wikibase\Repo\Notifications\ChangeNotifier::transmitChange ( EntityChange  $change)
private

Transmit changes via all registered transmitters.

Parameters
EntityChange$change

Member Data Documentation

◆ $centralIdLookup

Wikibase\Repo\Notifications\ChangeNotifier::$centralIdLookup
private

◆ $changeFactory

Wikibase\Repo\Notifications\ChangeNotifier::$changeFactory
private

◆ $changeTransmitters

Wikibase\Repo\Notifications\ChangeNotifier::$changeTransmitters
private

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