4 * Perform augmentation of each row and return composite result,
7 class PerRowAugmentor
implements ResultSetAugmentor
{
9 private ResultAugmentor
$rowAugmentor;
12 * @param ResultAugmentor $augmentor Per-result augmentor to use.
14 public function __construct( ResultAugmentor
$augmentor ) {
15 $this->rowAugmentor
= $augmentor;
19 * Produce data to augment search result set.
20 * @param ISearchResultSet $resultSet
21 * @return array Data for all results
23 public function augmentAll( ISearchResultSet
$resultSet ) {
25 foreach ( $resultSet->extractResults() as $result ) {
26 $id = $result->getTitle()->getArticleID();
30 $data[$id] = $this->rowAugmentor
->augment( $result );