Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97992519
AlmanacInterfaceSearchEngine.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jan 8, 09:17
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Jan 10, 09:17 (2 d)
Engine
blob
Format
Raw Data
Handle
23447651
Attached To
rPH Phabricator
AlmanacInterfaceSearchEngine.php
View Options
<?php
final
class
AlmanacInterfaceSearchEngine
extends
PhabricatorApplicationSearchEngine
{
public
function
getResultTypeDescription
()
{
return
pht
(
'Almanac Interfaces'
);
}
public
function
getApplicationClassName
()
{
return
'PhabricatorAlmanacApplication'
;
}
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
();
}
}
Event Timeline
Log In to Comment