X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fsearch%2FSqlSearchResultSet.php;h=022dc0a64371c0e9b3e70f7af6fd320604c0ddcb;hb=c2a308075f6a1740f06e05fbb2576a59d6ab0c87;hp=6b60899f10c65b053ba2af36228b6817efdf1d91;hpb=500889f19005b4aed93c5b6eaafd35689fce7dcd;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/search/SqlSearchResultSet.php b/includes/search/SqlSearchResultSet.php index 6b60899f10..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 ) - ); - } - - 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() {