Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4074983
MockSearchResultSet.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
MockSearchResultSet.php
View Options
<?php
class
MockSearchResultSet
extends
SearchResultSet
{
/**
* @var SearchResultSet[][] Map from result type to list of results for
* that type.
*/
private
$interwikiResults
;
/**
* @param SearchResult[]|callable[] $results
* @param ISearchResultSet[][]|callable[][] $interwikiResults Map from result type
* to list of results for that type.
*/
public
function
__construct
(
array
$results
,
array
$interwikiResults
=
[]
)
{
parent
::
__construct
(
false
,
false
);
$this
->
results
=
$results
;
$this
->
interwikiResults
=
$interwikiResults
;
}
public
function
numRows
()
{
return
count
(
$this
->
results
);
}
public
function
hasInterwikiResults
(
$type
=
self
::
SECONDARY_RESULTS
)
{
return
(
bool
)(
$this
->
interwikiResults
[
$type
]
??
false
);
}
public
function
extractResults
()
{
$results
=
parent
::
extractResults
();
foreach
(
$results
as
&
$result
)
{
// Resolve deferred results; needed to work around T203279
if
(
is_callable
(
$result
)
)
{
$result
=
$result
();
}
}
return
$results
;
}
public
function
getInterwikiResults
(
$type
=
self
::
SECONDARY_RESULTS
)
{
return
$this
->
interwikiResults
[
$type
]
??
[];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 17 2026, 17:18 (10 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
e8/73/e8a8efae47731686def61eb16a0f
Default Alt Text
MockSearchResultSet.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment