MediaWiki REL1_40
|
This is basically a CommentFormatter with a CommentStore dependency, allowing it to retrieve comment texts directly from database result wrappers. More...
Inherits MediaWiki\CommentFormatter\CommentFormatter.
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. | |
rows ( $rows) | |
Format DB rows using a fluent interface. | |
Public Member Functions inherited from MediaWiki\CommentFormatter\CommentFormatter | |
__construct (CommentParserFactory $parserFactory) | |
createBatch () | |
Format comments using a fluent interface. | |
createRevisionBatch () | |
Format a batch of revision comments using a fluent interface. | |
format (string $comment, LinkTarget $selfLinkTarget=null, $samePage=false, $wikiId=false) | |
Format a single comment. | |
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. | |
formatItems ( $items) | |
Format an iterator over CommentItem objects. | |
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. | |
formatLinksUnsafe (string $comment, LinkTarget $selfLinkTarget=null, $samePage=false, $wikiId=false) | |
Format a comment, passing through HTML in the input to the output. | |
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. | |
formatRevisions ( $revisions, Authority $authority, $samePage=false, $isPublic=false, $useParentheses=true, $indexById=false) | |
Format multiple revision comments. | |
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. | |
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. | |
Additional Inherited Members | |
Protected Member Functions inherited from MediaWiki\CommentFormatter\CommentFormatter | |
wrapCommentWithBlock ( $formatted, $useParentheses) | |
Wrap a comment in standard punctuation and formatting if it's non-empty, otherwise return empty string. | |
Protected Attributes inherited from MediaWiki\CommentFormatter\CommentFormatter | |
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< |
\stdClass>|IResultWrapper $rows
string | $commentKey | The comment key to pass through to CommentStore, typically a legacy field name. |
string | null | $namespaceField | The namespace field for the self-link target, or null to have no self-link target. |
string | null | $titleField | The title field for the self-link target, or null to have no self-link target. |
string | null | $indexField | The field to use for array keys in the result, or null to use the same keys as in the input $rows |
bool | $useBlock | Wrap the output in standard punctuation and formatting if it's non-empty. |
bool | $useParentheses | Wrap the output with parentheses. Has no effect if $useBlock is false. |
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().