MediaWiki master
RevisionCommentBatch.php
Go to the documentation of this file.
1<?php
2
4
7
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}
This is the main service interface for converting single-line comments from various DB comment fields...
Fluent interface for revision comment batch inputs.
revisions( $revisions)
Set the revisions to extract comments from.
authority(Authority $authority)
Set the authority to use for permission checks.
samePage( $samePage=true)
Set the same-page option.
indexById( $indexById=true)
If this is true, the array keys in the return value will be the revision IDs instead of the keys from...
useParentheses( $useParentheses=true)
Wrap the comment with parentheses.
hideIfDeleted( $isPublic=true)
If this is true, show the comment only if all users can see it.
Page revision base class.
This interface represents the authority associated with the current execution context,...
Definition Authority.php:37