MediaWiki  1.34.0
PerRowAugmentor.php
Go to the documentation of this file.
1 <?php
2 
8 
12  private $rowAugmentor;
13 
17  public function __construct( ResultAugmentor $augmentor ) {
18  $this->rowAugmentor = $augmentor;
19  }
20 
26  public function augmentAll( ISearchResultSet $resultSet ) {
27  $data = [];
28  foreach ( $resultSet->extractResults() as $result ) {
29  $id = $result->getTitle()->getArticleID();
30  if ( !$id ) {
31  continue;
32  }
33  $data[$id] = $this->rowAugmentor->augment( $result );
34  }
35  return $data;
36  }
37 }
ISearchResultSet\extractResults
extractResults()
Extract all the results in the result set as array.
PerRowAugmentor\$rowAugmentor
ResultAugmentor $rowAugmentor
Definition: PerRowAugmentor.php:12
PerRowAugmentor\__construct
__construct(ResultAugmentor $augmentor)
Definition: PerRowAugmentor.php:17
ISearchResultSet
A set of SearchEngine results.
Definition: ISearchResultSet.php:11
ResultSetAugmentor
Augment search results.
Definition: ResultSetAugmentor.php:6
ResultAugmentor
Augment search results.
Definition: ResultAugmentor.php:6
PerRowAugmentor\augmentAll
augmentAll(ISearchResultSet $resultSet)
Produce data to augment search result set.
Definition: PerRowAugmentor.php:26
PerRowAugmentor
Perform augmentation of each row and return composite result, indexed by ID.
Definition: PerRowAugmentor.php:7