Page MenuHomeWickedGov Phorge

PerRowAugmentor.php
No OneTemporary

Size
821 B
Referenced Files
None
Subscribers
None

PerRowAugmentor.php

<?php
/**
* Perform augmentation of each row and return composite result,
* indexed by ID.
*/
class PerRowAugmentor implements ResultSetAugmentor {
/**
* @var ResultAugmentor
*/
private $rowAugmentor;
/**
* @param ResultAugmentor $augmentor Per-result augmentor to use.
*/
public function __construct( ResultAugmentor $augmentor ) {
$this->rowAugmentor = $augmentor;
}
/**
* Produce data to augment search result set.
* @param ISearchResultSet $resultSet
* @return array Data for all results
*/
public function augmentAll( ISearchResultSet $resultSet ) {
$data = [];
foreach ( $resultSet->extractResults() as $result ) {
$id = $result->getTitle()->getArticleID();
if ( !$id ) {
continue;
}
$data[$id] = $this->rowAugmentor->augment( $result );
}
return $data;
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, May 16, 20:31 (1 d, 1 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
90/5a/eac6d90f9d9acd1808dcac33e323
Default Alt Text
PerRowAugmentor.php (821 B)

Event Timeline