39 private $suggestedTitle;
46 private $suggestedTitleID;
60 $suggestedTitleID =
null ) {
61 $this->score = $score;
63 if ( $suggestedTitle ) {
66 $this->suggestedTitleID = $suggestedTitleID;
82 public function setText( $text, $setTitle =
true ) {
84 if ( $setTitle && $text !==
'' && $text !==
null ) {
95 return $this->suggestedTitle;
102 $this->suggestedTitle =
$title;
114 return $this->suggestedTitleID;
121 $this->suggestedTitleID = $suggestedTitleID;
137 $this->score = $score;
175 $suggestion =
new self( $score, $text );
177 $suggestion->setSuggestedTitle( Title::newFromText( $text ) );
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
static fromText( $score, $text)
Create suggestion from text Will also create a title if text if not empty.
getSuggestedTitleID()
Title ID in the case this suggestion is based on a title.
setSuggestedTitle(Title $title=null)
setText( $text, $setTitle=true)
Set the suggestion text.
setURL( $url)
Set the suggestion URL.
setSuggestedTitleID( $suggestedTitleID=null)
getSuggestedTitle()
Title object in the case this suggestion is based on a title.
setScore( $score)
Set the suggestion score.
getURL()
Suggestion URL, can be the link to the Title or maybe in the future a link to the search results for ...
__construct( $score, $text=null, Title $suggestedTitle=null, $suggestedTitleID=null)
getScore()
Suggestion score.
getText()
The suggestion text.
static fromTitle( $score, Title $title)
Create suggestion from Title.
Represents a title within MediaWiki.