MediaWiki
master
RevisionCommentBatch.php
Go to the documentation of this file.
1
<?php
2
3
namespace
MediaWiki\CommentFormatter
;
4
5
use
MediaWiki\Permissions\Authority
;
6
use
MediaWiki\Revision\RevisionRecord
;
7
13
class
RevisionCommentBatch
{
15
private
$formatter;
17
private
$authority;
19
private
$revisions;
21
private
$samePage =
false
;
23
private
$isPublic =
false
;
25
private
$useParentheses =
false
;
27
private
$indexById =
false
;
28
29
public
function
__construct
(
CommentFormatter
$formatter ) {
30
$this->formatter = $formatter;
31
}
32
40
public
function
authority
(
Authority
$authority ) {
41
$this->
authority
= $authority;
42
return
$this;
43
}
44
51
public
function
revisions
( $revisions ) {
52
$this->
revisions
= $revisions;
53
return
$this;
54
}
55
66
public
function
samePage
( $samePage =
true
) {
67
$this->
samePage
= $samePage;
68
return
$this;
69
}
70
82
public
function
useParentheses
( $useParentheses =
true
) {
83
$this->
useParentheses
= $useParentheses;
84
return
$this;
85
}
86
96
public
function
hideIfDeleted
( $isPublic =
true
) {
97
$this->isPublic = $isPublic;
98
return
$this;
99
}
100
108
public
function
indexById
( $indexById =
true
) {
109
$this->
indexById
= $indexById;
110
return
$this;
111
}
112
120
public
function
execute
() {
121
return
$this->formatter->formatRevisions(
122
$this->
revisions
,
123
$this->
authority
,
124
$this->
samePage
,
125
$this->isPublic,
126
$this->
useParentheses
,
127
$this->
indexById
128
);
129
}
130
}
MediaWiki\CommentFormatter\CommentFormatter
This is the main service interface for converting single-line comments from various DB comment fields...
Definition
CommentFormatter.php:17
MediaWiki\CommentFormatter\RevisionCommentBatch
Fluent interface for revision comment batch inputs.
Definition
RevisionCommentBatch.php:13
MediaWiki\CommentFormatter\RevisionCommentBatch\execute
execute()
Format the comments.
Definition
RevisionCommentBatch.php:120
MediaWiki\CommentFormatter\RevisionCommentBatch\revisions
revisions( $revisions)
Set the revisions to extract comments from.
Definition
RevisionCommentBatch.php:51
MediaWiki\CommentFormatter\RevisionCommentBatch\authority
authority(Authority $authority)
Set the authority to use for permission checks.
Definition
RevisionCommentBatch.php:40
MediaWiki\CommentFormatter\RevisionCommentBatch\__construct
__construct(CommentFormatter $formatter)
Definition
RevisionCommentBatch.php:29
MediaWiki\CommentFormatter\RevisionCommentBatch\samePage
samePage( $samePage=true)
Set the same-page option.
Definition
RevisionCommentBatch.php:66
MediaWiki\CommentFormatter\RevisionCommentBatch\indexById
indexById( $indexById=true)
If this is true, the array keys in the return value will be the revision IDs instead of the keys from...
Definition
RevisionCommentBatch.php:108
MediaWiki\CommentFormatter\RevisionCommentBatch\useParentheses
useParentheses( $useParentheses=true)
Wrap the comment with parentheses.
Definition
RevisionCommentBatch.php:82
MediaWiki\CommentFormatter\RevisionCommentBatch\hideIfDeleted
hideIfDeleted( $isPublic=true)
If this is true, show the comment only if all users can see it.
Definition
RevisionCommentBatch.php:96
MediaWiki\Revision\RevisionRecord
Page revision base class.
Definition
RevisionRecord.php:49
MediaWiki\Permissions\Authority
This interface represents the authority associated with the current execution context,...
Definition
Authority.php:37
MediaWiki\CommentFormatter
Definition
CommentBatch.php:3
includes
CommentFormatter
RevisionCommentBatch.php
Generated on Sat May 24 2025 08:23:29 for MediaWiki by
1.10.0