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
32
public
function
__construct
(
CommentFormatter
$formatter
) {
33
$this->formatter =
$formatter
;
34
}
35
43
public
function
authority
(
Authority
$authority
) {
44
$this->
authority
=
$authority
;
45
return
$this;
46
}
47
54
public
function
revisions
(
$revisions
) {
55
$this->
revisions
=
$revisions
;
56
return
$this;
57
}
58
69
public
function
samePage
(
$samePage
=
true
) {
70
$this->
samePage
=
$samePage
;
71
return
$this;
72
}
73
85
public
function
useParentheses
(
$useParentheses
=
true
) {
86
$this->
useParentheses
=
$useParentheses
;
87
return
$this;
88
}
89
99
public
function
hideIfDeleted
(
$isPublic
=
true
) {
100
$this->isPublic =
$isPublic
;
101
return
$this;
102
}
103
111
public
function
indexById
(
$indexById
=
true
) {
112
$this->
indexById
=
$indexById
;
113
return
$this;
114
}
115
123
public
function
execute
() {
124
return
$this->formatter->formatRevisions(
125
$this->
revisions
,
126
$this->
authority
,
127
$this->
samePage
,
128
$this->isPublic,
129
$this->
useParentheses
,
130
$this->
indexById
131
);
132
}
133
}
MediaWiki\CommentFormatter\CommentFormatter
This is the main service interface for converting single-line comments from various DB comment fields...
Definition:
CommentFormatter.php:16
MediaWiki\CommentFormatter\RevisionCommentBatch
Fluent interface for revision comment batch inputs.
Definition:
RevisionCommentBatch.php:13
MediaWiki\CommentFormatter\RevisionCommentBatch\$indexById
bool $indexById
Definition:
RevisionCommentBatch.php:27
MediaWiki\CommentFormatter\RevisionCommentBatch\$revisions
iterable< RevisionRecord > $revisions
Definition:
RevisionCommentBatch.php:19
MediaWiki\CommentFormatter\RevisionCommentBatch\execute
execute()
Format the comments.
Definition:
RevisionCommentBatch.php:123
MediaWiki\CommentFormatter\RevisionCommentBatch\revisions
revisions( $revisions)
Set the revisions to extract comments from.
Definition:
RevisionCommentBatch.php:54
MediaWiki\CommentFormatter\RevisionCommentBatch\authority
authority(Authority $authority)
Set the authority to use for permission checks.
Definition:
RevisionCommentBatch.php:43
MediaWiki\CommentFormatter\RevisionCommentBatch\$authority
Authority null $authority
Definition:
RevisionCommentBatch.php:17
MediaWiki\CommentFormatter\RevisionCommentBatch\__construct
__construct(CommentFormatter $formatter)
Definition:
RevisionCommentBatch.php:32
MediaWiki\CommentFormatter\RevisionCommentBatch\samePage
samePage( $samePage=true)
Set the same-page option.
Definition:
RevisionCommentBatch.php:69
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:111
MediaWiki\CommentFormatter\RevisionCommentBatch\$formatter
CommentFormatter $formatter
Definition:
RevisionCommentBatch.php:15
MediaWiki\CommentFormatter\RevisionCommentBatch\useParentheses
useParentheses( $useParentheses=true)
Wrap the comment with parentheses.
Definition:
RevisionCommentBatch.php:85
MediaWiki\CommentFormatter\RevisionCommentBatch\$useParentheses
bool $useParentheses
Definition:
RevisionCommentBatch.php:25
MediaWiki\CommentFormatter\RevisionCommentBatch\hideIfDeleted
hideIfDeleted( $isPublic=true)
If this is true, show the comment only if all users can see it.
Definition:
RevisionCommentBatch.php:99
MediaWiki\CommentFormatter\RevisionCommentBatch\$samePage
bool $samePage
Definition:
RevisionCommentBatch.php:21
MediaWiki\CommentFormatter\RevisionCommentBatch\$isPublic
bool $isPublic
Definition:
RevisionCommentBatch.php:23
MediaWiki\Revision\RevisionRecord
Page revision base class.
Definition:
RevisionRecord.php:47
MediaWiki\Permissions\Authority
This interface represents the authority associated the current execution context, such as a web reque...
Definition:
Authority.php:37
MediaWiki\CommentFormatter
Definition:
CommentBatch.php:3
includes
CommentFormatter
RevisionCommentBatch.php
Generated on Sat Jun 25 2022 07:07:52 for MediaWiki by
1.9.1