aboutsummaryrefslogtreecommitdiffstats
path: root/includes/search/SearchNearMatchResultSet.php
blob: 6d25aa43d9b9050de407eae419cabe14c314134c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
/**
 * A ISearchResultSet wrapper for SearchNearMatcher
 */
class SearchNearMatchResultSet extends SearchResultSet {
	/**
	 * @param Title|null $match Title if matched, else null
	 */
	public function __construct( $match ) {
		if ( $match === null ) {
			$this->results = [];
		} else {
			$this->results = [ SearchResult::newFromTitle( $match, $this ) ];
		}
	}

	public function numRows() {
		return $this->results ? 1 : 0;
	}
}