Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Client\RecentChanges\SiteLinkCommentCreator Class Reference

Creates an array structure with comment information for storing in the rc_params column of the RecentChange table, for use in generating recent change comments for wikibase changes. More...

Public Member Functions

 __construct (Language $language, SiteLookup $siteLookup, $siteId)
 
 getEditComment (?Diff $siteLinkDiff, $action, Title $title=null)
 Returns the comment to use in RC and history entries for this change.
 
 needsTargetSpecificSummary (Diff $siteLinkDiff, Title $title)
 Whether we need a target specific edit summary for the given diff on the given page.
 

Private Member Functions

 getSiteLinkMessage ( $action, Diff $siteLinkDiff, Title $title=null)
 Returns an array structure suitable for building an edit summary for the respective change to site links.
 
 getSiteLinkChangeParams (array $diffs)
 
 getChangeParamsForDiffOp (DiffOp $diffOp, $siteId, $messagePrefix)
 
 getSiteLinkAddRemoveParams (DiffOp $diffOp, $action, $siteId, Title $title=null)
 
 getSitelinkWikitext ( $siteId, $pageTitle)
 
 msg ( $key,... $params)
 
 generateComment (array $messageSpec)
 

Private Attributes

 $language
 
 $siteLookup
 
 $siteId
 

Detailed Description

Creates an array structure with comment information for storing in the rc_params column of the RecentChange table, for use in generating recent change comments for wikibase changes.

Author
Katie Filbert < aude..nosp@m.wiki.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\RecentChanges\SiteLinkCommentCreator::__construct ( Language $language,
SiteLookup $siteLookup,
$siteId )
Parameters
Language$language
SiteLookup$siteLookup
string$siteId

Member Function Documentation

◆ generateComment()

Wikibase\Client\RecentChanges\SiteLinkCommentCreator::generateComment ( array $messageSpec)
private
Parameters
array$messageSpec
Returns
string An edit summary (as limited wikitext).

◆ getChangeParamsForDiffOp()

Wikibase\Client\RecentChanges\SiteLinkCommentCreator::getChangeParamsForDiffOp ( DiffOp $diffOp,
$siteId,
$messagePrefix )
private
Parameters
DiffOp$diffOp
string$siteId
string$messagePrefix
Returns
array|null

◆ getEditComment()

Wikibase\Client\RecentChanges\SiteLinkCommentCreator::getEditComment ( ?Diff $siteLinkDiff,
$action,
Title $title = null )

Returns the comment to use in RC and history entries for this change.

This may be a complex structure. It will be interpreted by

Parameters
Diff | null$siteLinkDiff
string$actione.g. 'remove', see the constants in EntityChange
Title | null$titleThe page we create an edit summary for. Taken into account when creating an article specific edit summary on site link changes. Ignored otherwise.
Returns
string|null A human readable edit summary (limited wikitext), or null if no summary could be created for the sitelink change.

◆ getSiteLinkAddRemoveParams()

Wikibase\Client\RecentChanges\SiteLinkCommentCreator::getSiteLinkAddRemoveParams ( DiffOp $diffOp,
$action,
$siteId,
Title $title = null )
private
Parameters
DiffOp$diffOp
string$actione.g. 'remove', see the constants in EntityChange
string$siteId
Title | null$titleThe page we create an edit summary for
Returns
array|null

◆ getSiteLinkChangeParams()

Wikibase\Client\RecentChanges\SiteLinkCommentCreator::getSiteLinkChangeParams ( array $diffs)
private
Parameters
DiffOp[]$diffs
Returns
array|null

◆ getSiteLinkMessage()

Wikibase\Client\RecentChanges\SiteLinkCommentCreator::getSiteLinkMessage ( $action,
Diff $siteLinkDiff,
Title $title = null )
private

Returns an array structure suitable for building an edit summary for the respective change to site links.

Parameters
string$actione.g. 'remove', see the constants in EntityChange
Diff$siteLinkDiffThe change's site link diff
Title | null$titleThe page we create an edit summary for
Returns
array|null

◆ getSitelinkWikitext()

Wikibase\Client\RecentChanges\SiteLinkCommentCreator::getSitelinkWikitext ( $siteId,
$pageTitle )
private
Parameters
string$siteId
string$pageTitle
Returns
string wikitext interwiki link

◆ msg()

Wikibase\Client\RecentChanges\SiteLinkCommentCreator::msg ( $key,
$params )
private
Parameters
string$key
Returns
Message

◆ needsTargetSpecificSummary()

Wikibase\Client\RecentChanges\SiteLinkCommentCreator::needsTargetSpecificSummary ( Diff $siteLinkDiff,
Title $title )

Whether we need a target specific edit summary for the given diff on the given page.

Parameters
Diff$siteLinkDiff
Title$title
Returns
bool

Member Data Documentation

◆ $language

Wikibase\Client\RecentChanges\SiteLinkCommentCreator::$language
private

◆ $siteId

Wikibase\Client\RecentChanges\SiteLinkCommentCreator::$siteId
private

◆ $siteLookup

Wikibase\Client\RecentChanges\SiteLinkCommentCreator::$siteLookup
private

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