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