Wikibase
MediaWiki Wikibase extension
Wikibase\Client\Changes\ChangeHandler Class Reference

Interface for change handling. More...

Public Member Functions

 __construct (AffectedPagesFinder $affectedPagesFinder, TitleFactory $titleFactory, PageUpdater $updater, ChangeRunCoalescer $changeRunCoalescer, LoggerInterface $logger, $injectRecentChanges=true)
 
 handleChanges (array $changes, array $rootJobParams=[])
 
 handleChange (EntityChange $change, array $rootJobParams=[])
 Main entry point for handling changes. More...
 

Private Member Functions

 getTitleBatchSignature (array $titles)
 
 getChangeSignature (EntityChange $change)
 
 getTitlesForUsages ( $usagesPerPage)
 
 getChangeIdForLog (Change $change)
 Returns a human readable change ID, containing multiple IDs in case of a coalesced change. More...
 

Private Attributes

 $affectedPagesFinder
 
 $titleFactory
 
 $updater
 
 $changeRunCoalescer
 
 $logger
 
 $injectRecentChanges
 

Detailed Description

Interface for change handling.

Whenever a change is detected, it should be fed to this service which then takes care handling it.

See also
md_docs_topics_change-propagation for an overview of the change propagation mechanism.
Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\Changes\ChangeHandler::__construct ( AffectedPagesFinder  $affectedPagesFinder,
TitleFactory  $titleFactory,
PageUpdater  $updater,
ChangeRunCoalescer  $changeRunCoalescer,
LoggerInterface  $logger,
  $injectRecentChanges = true 
)
Parameters
AffectedPagesFinder$affectedPagesFinder
TitleFactory$titleFactory
PageUpdater$updater
ChangeRunCoalescer$changeRunCoalescer
LoggerInterface$logger
bool$injectRecentChanges
Exceptions
InvalidArgumentException

Member Function Documentation

◆ getChangeIdForLog()

Wikibase\Client\Changes\ChangeHandler::getChangeIdForLog ( Change  $change)
private

Returns a human readable change ID, containing multiple IDs in case of a coalesced change.

Parameters
Change$change
Returns
string

◆ getChangeSignature()

Wikibase\Client\Changes\ChangeHandler::getChangeSignature ( EntityChange  $change)
private
Parameters
EntityChange$change
Returns
string a signature representing the change's identity.

◆ getTitleBatchSignature()

Wikibase\Client\Changes\ChangeHandler::getTitleBatchSignature ( array  $titles)
private
Parameters
Title[]$titles
Returns
string a signature based on the hash of the given titles
See also
WikiPageUpdater::getPageParamForRefreshLinksJob

◆ getTitlesForUsages()

Wikibase\Client\Changes\ChangeHandler::getTitlesForUsages (   $usagesPerPage)
private
Parameters
PageEntityUsages[]$usagesPerPage
Returns
Title[]

◆ handleChange()

Wikibase\Client\Changes\ChangeHandler::handleChange ( EntityChange  $change,
array  $rootJobParams = [] 
)

Main entry point for handling changes.

Todo:
process multiple changes at once!
Parameters
EntityChange$change
array$rootJobParamsany relevant root job parameters to be inherited by new jobs.

◆ handleChanges()

Wikibase\Client\Changes\ChangeHandler::handleChanges ( array  $changes,
array  $rootJobParams = [] 
)
Parameters
EntityChange[]$changes
array$rootJobParamsany relevant root job parameters to be inherited by new jobs.

Member Data Documentation

◆ $affectedPagesFinder

Wikibase\Client\Changes\ChangeHandler::$affectedPagesFinder
private

◆ $changeRunCoalescer

Wikibase\Client\Changes\ChangeHandler::$changeRunCoalescer
private

◆ $injectRecentChanges

Wikibase\Client\Changes\ChangeHandler::$injectRecentChanges
private

◆ $logger

Wikibase\Client\Changes\ChangeHandler::$logger
private

◆ $titleFactory

Wikibase\Client\Changes\ChangeHandler::$titleFactory
private

◆ $updater

Wikibase\Client\Changes\ChangeHandler::$updater
private

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