Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F468943
AlmanacInterfaceSearchEngine.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
AlmanacInterfaceSearchEngine.php
View Options
<?php
final
class
AlmanacInterfaceSearchEngine
extends
PhabricatorApplicationSearchEngine
{
public
function
getResultTypeDescription
()
{
return
pht
(
'Almanac Interfaces'
);
}
public
function
getApplicationClassName
()
{
return
PhabricatorAlmanacApplication
::
class
;
}
public
function
newQuery
()
{
return
new
AlmanacInterfaceQuery
();
}
protected
function
buildCustomSearchFields
()
{
return
array
(
id
(
new
PhabricatorPHIDsSearchField
())
->
setLabel
(
pht
(
'Devices'
))
->
setKey
(
'devicePHIDs'
)
->
setAliases
(
array
(
'device'
,
'devicePHID'
,
'devices'
))
->
setDescription
(
pht
(
'Search for interfaces on particular devices.'
)),
);
}
protected
function
buildQueryFromParameters
(
array
$map
)
{
$query
=
$this
->
newQuery
();
if
(
$map
[
'devicePHIDs'
])
{
$query
->
withDevicePHIDs
(
$map
[
'devicePHIDs'
]);
}
return
$query
;
}
protected
function
getURI
(
$path
)
{
return
'/almanac/interface/'
.
$path
;
}
protected
function
getBuiltinQueryNames
()
{
$names
=
array
(
'all'
=>
pht
(
'All Interfaces'
),
);
return
$names
;
}
public
function
buildSavedQueryFromBuiltin
(
$query_key
)
{
$query
=
$this
->
newSavedQuery
();
$query
->
setQueryKey
(
$query_key
);
switch
(
$query_key
)
{
case
'all'
:
return
$query
;
}
return
parent
::
buildSavedQueryFromBuiltin
(
$query_key
);
}
protected
function
renderResultList
(
array
$devices
,
PhabricatorSavedQuery
$query
,
array
$handles
)
{
// For now, this SearchEngine just supports API access via Conduit.
throw
new
PhutilMethodNotImplementedException
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, May 6, 6:55 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
80944
Default Alt Text
AlmanacInterfaceSearchEngine.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment