Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5984119
SpecialSearchTestMockResultSet.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
SpecialSearchTestMockResultSet.php
View Options
<?php
use
MediaWiki\Title\Title
;
class
SpecialSearchTestMockResultSet
extends
SearchResultSet
{
private
?
string
$suggestion
;
private
?
string
$rewrittenQuery
;
public
function
__construct
(
?
string
$suggestion
=
null
,
?
string
$rewrittenQuery
=
null
,
array
$results
=
[],
bool
$containedSyntax
=
false
)
{
$this
->
suggestion
=
$suggestion
;
$this
->
rewrittenQuery
=
$rewrittenQuery
;
$this
->
results
=
$results
;
$this
->
containedSyntax
=
$containedSyntax
;
}
public
function
getTotalHits
()
{
return
$this
->
numRows
();
}
public
function
hasSuggestion
()
{
return
$this
->
suggestion
!==
null
;
}
public
function
getSuggestionQuery
()
{
return
$this
->
suggestion
;
}
public
function
getSuggestionSnippet
()
{
return
$this
->
suggestion
;
}
public
function
hasRewrittenQuery
()
{
return
$this
->
rewrittenQuery
!==
null
;
}
public
function
getQueryAfterRewrite
()
{
return
$this
->
rewrittenQuery
;
}
public
function
getQueryAfterRewriteSnippet
()
{
return
htmlspecialchars
(
$this
->
rewrittenQuery
);
}
public
function
getFirstResult
():
?
Title
{
$first
=
reset
(
$this
->
results
);
return
$first
?
$first
->
getTitle
()
:
null
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 23:11 (1 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1d/80/18a5e59e7c3334b64efcd50c76d8
Default Alt Text
SpecialSearchTestMockResultSet.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment