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