MediaWiki REL1_39
|
Search suggestion. More...
Public Member Functions | |
__construct ( $score, $text=null, Title $suggestedTitle=null, $suggestedTitleID=null) | |
getScore () | |
Suggestion score. | |
getSuggestedTitle () | |
Title object in the case this suggestion is based on a title. | |
getSuggestedTitleID () | |
Title ID in the case this suggestion is based on a title. | |
getText () | |
The suggestion text. | |
getURL () | |
Suggestion URL, can be the link to the Title or maybe in the future a link to the search results for this search suggestion. | |
setScore ( $score) | |
Set the suggestion score. | |
setSuggestedTitle (Title $title=null) | |
setSuggestedTitleID ( $suggestedTitleID=null) | |
setText ( $text, $setTitle=true) | |
Set the suggestion text. | |
setURL ( $url) | |
Set the suggestion URL. | |
Static Public Member Functions | |
static | fromText ( $score, $text) |
Create suggestion from text Will also create a title if text if not empty. | |
static | fromTitle ( $score, Title $title) |
Create suggestion from Title. | |
Search suggestion.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html A search suggestion
Definition at line 25 of file SearchSuggestion.php.
SearchSuggestion::__construct | ( | $score, | |
$text = null, | |||
Title | $suggestedTitle = null, | ||
$suggestedTitleID = null ) |
float | $score | the suggestion score |
string | null | $text | the suggestion text |
Title | null | $suggestedTitle | |
int | null | $suggestedTitleID |
Definition at line 59 of file SearchSuggestion.php.
References setSuggestedTitle().
|
static |
Create suggestion from text Will also create a title if text if not empty.
float | $score | Suggestions score |
string | $text |
Definition at line 174 of file SearchSuggestion.php.
|
static |
Create suggestion from Title.
float | $score | Suggestions score |
Title | $title |
Definition at line 163 of file SearchSuggestion.php.
References $title.
SearchSuggestion::getScore | ( | ) |
Suggestion score.
Definition at line 128 of file SearchSuggestion.php.
Referenced by SearchSuggestionSet\append(), and SearchSuggestionSet\prepend().
SearchSuggestion::getSuggestedTitle | ( | ) |
Title object in the case this suggestion is based on a title.
May return null if the suggestion is not a Title.
Definition at line 94 of file SearchSuggestion.php.
Referenced by SearchEngine\extractTitles(), and SearchEngine\processCompletionResults().
SearchSuggestion::getSuggestedTitleID | ( | ) |
Title ID in the case this suggestion is based on a title.
May return null if the suggestion is not a Title.
Definition at line 113 of file SearchSuggestion.php.
Referenced by SearchSuggestionSet\append(), and SearchSuggestionSet\prepend().
SearchSuggestion::getText | ( | ) |
SearchSuggestion::getURL | ( | ) |
Suggestion URL, can be the link to the Title or maybe in the future a link to the search results for this search suggestion.
Definition at line 145 of file SearchSuggestion.php.
SearchSuggestion::setScore | ( | $score | ) |
Set the suggestion score.
float | $score |
Definition at line 136 of file SearchSuggestion.php.
Referenced by SearchSuggestionSet\append(), and SearchSuggestionSet\prepend().
SearchSuggestion::setSuggestedTitle | ( | Title | $title = null | ) |
Title | null | $title |
Definition at line 101 of file SearchSuggestion.php.
References $title, PROTO_CURRENT, and wfExpandUrl().
Referenced by __construct(), and setText().
SearchSuggestion::setSuggestedTitleID | ( | $suggestedTitleID = null | ) |
int | null | $suggestedTitleID |
Definition at line 120 of file SearchSuggestion.php.
SearchSuggestion::setText | ( | $text, | |
$setTitle = true ) |
Set the suggestion text.
string | $text | |
bool | $setTitle | Should we also update the title? |
Definition at line 82 of file SearchSuggestion.php.
References setSuggestedTitle().
SearchSuggestion::setURL | ( | $url | ) |