MediaWiki REL1_39
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
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}
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 the current execution context, such as a web reque...
Definition Authority.php:37