From: Chad Horohoe Date: Fri, 12 Sep 2014 19:37:35 +0000 (-0700) Subject: SearchResult: clean up construction X-Git-Tag: 1.31.0-rc.0~14055^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=9b3f84e763810ab101bfc2bdcee7a319eb73218c SearchResult: clean up construction - Remove old pre-1.17 constructor format. No core or extension callers - Remove only usage of newFromRow(), needless abstraction Change-Id: Ifad161aa36837bb4c8b5c9aecac1c46e2e6cc84c --- diff --git a/includes/search/SearchResult.php b/includes/search/SearchResult.php index c6d5d4ffc1..aeaba8df32 100644 --- a/includes/search/SearchResult.php +++ b/includes/search/SearchResult.php @@ -61,35 +61,6 @@ class SearchResult { return $result; } - /** - * Return a new SearchResult and initializes it with a row. - * - * @param object $row - * @return SearchResult - */ - public static function newFromRow( $row ) { - $result = new self(); - $result->initFromRow( $row ); - return $result; - } - - public function __construct( $row = null ) { - if ( !is_null( $row ) ) { - // Backwards compatibility with pre-1.17 callers - $this->initFromRow( $row ); - } - } - - /** - * Initialize from a database row. Makes a Title and passes that to - * initFromTitle. - * - * @param object $row - */ - protected function initFromRow( $row ) { - $this->initFromTitle( Title::makeTitle( $row->page_namespace, $row->page_title ) ); - } - /** * Initialize from a Title and if possible initializes a corresponding * Revision and File. diff --git a/includes/search/SearchResultSet.php b/includes/search/SearchResultSet.php index 698f93c287..406d322d6f 100644 --- a/includes/search/SearchResultSet.php +++ b/includes/search/SearchResultSet.php @@ -161,7 +161,9 @@ class SqlSearchResultSet extends SearchResultSet { return false; } - return SearchResult::newFromRow( $row ); + return SearchResult::newFromTitle( + Title::makeTitle( $row->page_namespace, $row->page_title ) + ); } function free() {