MediaWiki REL1_40
|
An adaptor which converts a row iterator into a CommentItem iterator for batch formatting. More...
Inherits IteratorIterator.
Public Member Functions | |
__construct (CommentStore $commentStore, $rows) | |
commentKey ( $key) | |
Set what CommentStore calls the key – typically a legacy field name which once held a comment. | |
current () | |
indexField ( $field) | |
Set the index field. | |
key () | |
namespaceField ( $field) | |
Set the namespace field. | |
titleField ( $field) | |
Set the title field. | |
An adaptor which converts a row iterator into a CommentItem iterator for batch formatting.
Fluent-style mutators are provided to configure how comment text is extracted from rows.
Using an iterator for this configuration, instead of putting the options in CommentBatch, allows CommentBatch to be a simple single class without a CommentStore dependency.
Definition at line 24 of file RowCommentIterator.php.
MediaWiki\CommentFormatter\RowCommentIterator::__construct | ( | CommentStore | $commentStore, |
$rows ) |
CommentStore | $commentStore | |
Traversable | array | $rows |
Definition at line 41 of file RowCommentIterator.php.
MediaWiki\CommentFormatter\RowCommentIterator::commentKey | ( | $key | ) |
Set what CommentStore calls the key – typically a legacy field name which once held a comment.
This must be called before attempting iteration.
string | $key |
Definition at line 59 of file RowCommentIterator.php.
References MediaWiki\CommentFormatter\RowCommentIterator\commentKey().
Referenced by MediaWiki\CommentFormatter\RowCommentIterator\commentKey().
MediaWiki\CommentFormatter\RowCommentIterator::current | ( | ) |
Definition at line 109 of file RowCommentIterator.php.
MediaWiki\CommentFormatter\RowCommentIterator::indexField | ( | $field | ) |
Set the index field.
Values from this field will appear as array keys in the final formatted comment array. If unset, the array will be numerically indexed.
string | $field |
Definition at line 96 of file RowCommentIterator.php.
References MediaWiki\CommentFormatter\RowCommentIterator\indexField().
Referenced by MediaWiki\CommentFormatter\RowCommentIterator\indexField(), and MediaWiki\CommentFormatter\RowCommentIterator\key().
MediaWiki\CommentFormatter\RowCommentIterator::key | ( | ) |
Definition at line 101 of file RowCommentIterator.php.
References MediaWiki\CommentFormatter\RowCommentIterator\indexField().
MediaWiki\CommentFormatter\RowCommentIterator::namespaceField | ( | $field | ) |
Set the namespace field.
If this is not called, the item will not have a self-link target, although it may be provided by the batch.
string | $field |
Definition at line 71 of file RowCommentIterator.php.
References MediaWiki\CommentFormatter\RowCommentIterator\namespaceField().
Referenced by MediaWiki\CommentFormatter\RowCommentIterator\namespaceField().
MediaWiki\CommentFormatter\RowCommentIterator::titleField | ( | $field | ) |
Set the title field.
If this is not called, the item will not have a self-link target, although it may be provided by the batch.
string | $field |
Definition at line 83 of file RowCommentIterator.php.
References MediaWiki\CommentFormatter\RowCommentIterator\titleField().
Referenced by MediaWiki\CommentFormatter\RowCommentIterator\titleField().