X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fsearch%2FSqlSearchResultSet.php;h=022dc0a64371c0e9b3e70f7af6fd320604c0ddcb;hb=c2a308075f6a1740f06e05fbb2576a59d6ab0c87;hp=c3985d1852f167438d60b4bcd8c5442e690ab0bb;hpb=32d2f5675fa2cf50edb224608d178dc8babdd4a2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/search/SqlSearchResultSet.php b/includes/search/SqlSearchResultSet.php index c3985d1852..022dc0a643 100644 --- a/includes/search/SqlSearchResultSet.php +++ b/includes/search/SqlSearchResultSet.php @@ -1,11 +1,17 @@ resultSet->numRows(); } - function next() { + public function extractResults() { if ( $this->resultSet === false ) { - return false; - } - - $row = $this->resultSet->fetchObject(); - if ( $row === false ) { - return false; + return []; } - return SearchResult::newFromTitle( - Title::makeTitle( $row->page_namespace, $row->page_title ), $this - ); - } - - function rewind() { - if ( $this->resultSet ) { + if ( $this->results === null ) { + $this->results = []; $this->resultSet->rewind(); + while ( ( $row = $this->resultSet->fetchObject() ) !== false ) { + $this->results[] = SearchResult::newFromTitle( + Title::makeTitle( $row->page_namespace, $row->page_title ), $this + ); + } } + return $this->results; } function free() {