MediaWiki
master
|
This is basically a CommentFormatter with a CommentStore dependency, allowing it to retrieve comment texts directly from database result wrappers. More...
Public Member Functions | |
__construct (CommentParserFactory $commentParserFactory, CommentStore $commentStore) | |
formatRows ( $rows, $commentKey, $namespaceField=null, $titleField=null, $indexField=null, $useBlock=false, $useParentheses=true) | |
Format DB rows using a parametric interface. More... | |
rows ( $rows) | |
Format DB rows using a fluent interface. More... | |
![]() | |
__construct (CommentParserFactory $parserFactory) | |
createBatch () | |
Format comments using a fluent interface. More... | |
createRevisionBatch () | |
Format a batch of revision comments using a fluent interface. More... | |
format (string $comment, LinkTarget $selfLinkTarget=null, $samePage=false, $wikiId=false) | |
Format a single comment. More... | |
formatBlock (string $comment, LinkTarget $selfLinkTarget=null, $samePage=false, $wikiId=false, $useParentheses=true) | |
Wrap a comment in standard punctuation and formatting if it's non-empty, otherwise return an empty string. More... | |
formatItems ( $items) | |
Format an iterator over CommentItem objects. More... | |
formatItemsInternal ( $items, $selfLinkTarget=null, $samePage=null, $wikiId=null, $enableSectionLinks=null, $useBlock=null, $useParentheses=null) | |
formatLinks (string $comment, LinkTarget $selfLinkTarget=null, $samePage=false, $wikiId=false) | |
Format links in a comment, ignoring section links in C-style comments. More... | |
formatLinksUnsafe (string $comment, LinkTarget $selfLinkTarget=null, $samePage=false, $wikiId=false) | |
Format a comment, passing through HTML in the input to the output. More... | |
formatRevision (RevisionRecord $revision, Authority $authority, $samePage=false, $isPublic=false, $useParentheses=true) | |
Wrap and format the given revision's comment block, if the specified user is allowed to view it. More... | |
formatRevisions ( $revisions, Authority $authority, $samePage=false, $isPublic=false, $useParentheses=true, $indexById=false) | |
Format multiple revision comments. More... | |
formatStrings ( $strings, LinkTarget $selfLinkTarget=null, $samePage=false, $wikiId=false) | |
Format comments which are provided as strings and all have the same self-link target and other options. More... | |
formatStringsAsBlock ( $strings, LinkTarget $selfLinkTarget=null, $samePage=false, $wikiId=false, $useParentheses=true) | |
Given an array of comments as strings which all have the same self link target, format the comments and wrap them in standard punctuation and formatting. More... | |
Additional Inherited Members | |
![]() | |
wrapCommentWithBlock ( $formatted, $useParentheses) | |
Wrap a comment in standard punctuation and formatting if it's non-empty, otherwise return empty string. More... | |
![]() | |
CommentParserFactory | $parserFactory |
This is basically a CommentFormatter with a CommentStore dependency, allowing it to retrieve comment texts directly from database result wrappers.
Definition at line 15 of file RowCommentFormatter.php.
MediaWiki\CommentFormatter\RowCommentFormatter::__construct | ( | CommentParserFactory | $commentParserFactory, |
CommentStore | $commentStore | ||
) |
CommentParserFactory | $commentParserFactory | |
CommentStore | $commentStore |
Definition at line 25 of file RowCommentFormatter.php.
MediaWiki\CommentFormatter\RowCommentFormatter::formatRows | ( | $rows, | |
$commentKey, | |||
$namespaceField = null , |
|||
$titleField = null , |
|||
$indexField = null , |
|||
$useBlock = false , |
|||
$useParentheses = true |
|||
) |
Format DB rows using a parametric interface.
iterable< |
Definition at line 73 of file RowCommentFormatter.php.
References MediaWiki\CommentFormatter\CommentFormatter\createBatch(), and MediaWiki\CommentFormatter\RowCommentFormatter\rows().
MediaWiki\CommentFormatter\RowCommentFormatter::rows | ( | $rows | ) |
Format DB rows using a fluent interface.
Pass the return value of this function to CommentBatch::comments().
Example: $comments = $rowCommentFormatter->createBatch() ->comments( $rowCommentFormatter->rows( $rows ) ->commentField( 'img_comment' ) ) ->useBlock( true ) ->execute();
Traversable | array | $rows |
Definition at line 49 of file RowCommentFormatter.php.
Referenced by MediaWiki\CommentFormatter\RowCommentFormatter\formatRows().