MediaWiki
1.34.0
|
Search suggestion. More...
Public Member Functions | |
__construct ( $score, $text=null, Title $suggestedTitle=null, $suggestedTitleID=null) | |
Construct a new suggestion. More... | |
getScore () | |
Suggestion score. More... | |
getSuggestedTitle () | |
Title object in the case this suggestion is based on a title. More... | |
getSuggestedTitleID () | |
Title ID in the case this suggestion is based on a title. More... | |
getText () | |
The suggestion text. More... | |
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. More... | |
setScore ( $score) | |
Set the suggestion score. More... | |
setSuggestedTitle (Title $title=null) | |
Set the suggested title. More... | |
setSuggestedTitleID ( $suggestedTitleID=null) | |
Set the suggested title ID. More... | |
setText ( $text, $setTitle=true) | |
Set the suggestion text. More... | |
setURL ( $url) | |
Set the suggestion URL. More... | |
Static Public Member Functions | |
static | fromText ( $score, $text) |
Create suggestion from text Will also create a title if text if not empty. More... | |
static | fromTitle ( $score, Title $title) |
Create suggestion from Title. More... | |
Private Attributes | |
float null | $score |
The suggestion score. More... | |
Title null | $suggestedTitle |
the suggested title More... | |
int null | $suggestedTitleID |
NOTE: even if suggestedTitle is a redirect suggestedTitleID is the ID of the target page. More... | |
string | $text |
the suggestion More... | |
string | $url |
the suggestion URL More... | |
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 |
|||
) |
Construct a new suggestion.
float | $score | the suggestion score |
string | null | $text | the suggestion text |
Title | null | $suggestedTitle | the suggested title |
int | null | $suggestedTitleID | the suggested title ID |
Definition at line 60 of file SearchSuggestion.php.
References $score, $suggestedTitle, $suggestedTitleID, $text, and 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 177 of file SearchSuggestion.php.
References $score, $text, and Title\makeTitle().
Referenced by SearchSuggestionSet\fromStrings().
|
static |
Create suggestion from Title.
float | $score | Suggestions score |
Title | $title |
Definition at line 166 of file SearchSuggestion.php.
References $score, and $title.
Referenced by SearchSuggestionSet\fromTitles(), and SearchEngine\processCompletionResults().
SearchSuggestion::getScore | ( | ) |
Suggestion score.
Definition at line 131 of file SearchSuggestion.php.
References $score.
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 95 of file SearchSuggestion.php.
References $suggestedTitle.
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 115 of file SearchSuggestion.php.
References $suggestedTitleID.
Referenced by SearchSuggestionSet\append(), and SearchSuggestionSet\prepend().
SearchSuggestion::getText | ( | ) |
The suggestion text.
Definition at line 74 of file SearchSuggestion.php.
References $text.
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 148 of file SearchSuggestion.php.
References $url.
SearchSuggestion::setScore | ( | $score | ) |
Set the suggestion score.
float | $score |
Definition at line 139 of file SearchSuggestion.php.
References $score.
Referenced by SearchSuggestionSet\append(), and SearchSuggestionSet\prepend().
SearchSuggestion::setSuggestedTitle | ( | Title | $title = null | ) |
Set the suggested title.
Title | null | $title |
Definition at line 103 of file SearchSuggestion.php.
References $title, PROTO_CURRENT, and wfExpandUrl().
Referenced by __construct(), and setText().
SearchSuggestion::setSuggestedTitleID | ( | $suggestedTitleID = null | ) |
Set the suggested title ID.
int | null | $suggestedTitleID |
Definition at line 123 of file SearchSuggestion.php.
References $suggestedTitleID.
SearchSuggestion::setText | ( | $text, | |
$setTitle = true |
|||
) |
Set the suggestion text.
string | $text | |
bool | $setTitle | Should we also update the title? |
Definition at line 83 of file SearchSuggestion.php.
References $text, Title\makeTitle(), and setSuggestedTitle().
SearchSuggestion::setURL | ( | $url | ) |
Set the suggestion URL.
string | $url |
Definition at line 156 of file SearchSuggestion.php.
References $url.
|
private |
The suggestion score.
Definition at line 51 of file SearchSuggestion.php.
Referenced by __construct(), fromText(), fromTitle(), getScore(), and setScore().
|
private |
the suggested title
Definition at line 39 of file SearchSuggestion.php.
Referenced by __construct(), and getSuggestedTitle().
|
private |
NOTE: even if suggestedTitle is a redirect suggestedTitleID is the ID of the target page.
the suggested title ID
Definition at line 46 of file SearchSuggestion.php.
Referenced by __construct(), getSuggestedTitleID(), and setSuggestedTitleID().
|
private |
the suggestion
Definition at line 29 of file SearchSuggestion.php.
Referenced by __construct(), fromText(), getText(), and setText().
|
private |
the suggestion URL
Definition at line 34 of file SearchSuggestion.php.