This is implemented in CirrusSearch so the result set can be looped
through multiple times. In general having a rewind function on any
iterator is probably a good idea, so pushing it into the upstream
interface.
Change-Id: Iaac9c11d8742288610011a2a0f6282944d35d5f3
$this->fetched = true;
return SearchResult::newFromTitle( $this->result );
}
+
+ public function rewind() {
+ $this->fetched = false;
+ }
}
return false;
}
+ /**
+ * Rewind result set back to begining
+ */
+ function rewind() {
+ }
+
/**
* Frees the result set, if applicable.
*/
protected $terms;
protected $totalHits;
- function __construct( $resultSet, $terms, $total = null ) {
+ function __construct( ResultWrapper $resultSet, $terms, $total = null ) {
$this->resultSet = $resultSet;
$this->terms = $terms;
$this->totalHits = $total;
);
}
+ function rewind() {
+ if ( $this->resultSet ) {
+ $this->resultSet->rewind();
+ }
+ }
+
function free() {
if ( $this->resultSet === false ) {
return false;