Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F103171684
HarbormasterBuildTargetSearchEngine.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
Thu, Feb 27, 21:38
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Mar 1, 21:38 (2 d)
Engine
blob
Format
Raw Data
Handle
24511260
Attached To
rPH Phabricator
HarbormasterBuildTargetSearchEngine.php
View Options
<?php
final
class
HarbormasterBuildTargetSearchEngine
extends
PhabricatorApplicationSearchEngine
{
public
function
getResultTypeDescription
()
{
return
pht
(
'Harbormaster Build Targets'
);
}
public
function
getApplicationClassName
()
{
return
'PhabricatorHarbormasterApplication'
;
}
public
function
newQuery
()
{
return
new
HarbormasterBuildTargetQuery
();
}
protected
function
buildCustomSearchFields
()
{
return
array
(
id
(
new
PhabricatorSearchDatasourceField
())
->
setLabel
(
pht
(
'Builds'
))
->
setKey
(
'buildPHIDs'
)
->
setAliases
(
array
(
'build'
,
'builds'
,
'buildPHID'
))
->
setDescription
(
pht
(
'Search for targets of a given build.'
))
->
setDatasource
(
new
HarbormasterBuildPlanDatasource
()),
);
}
protected
function
buildQueryFromParameters
(
array
$map
)
{
$query
=
$this
->
newQuery
();
if
(
$map
[
'buildPHIDs'
])
{
$query
->
withBuildPHIDs
(
$map
[
'buildPHIDs'
]);
}
return
$query
;
}
protected
function
getURI
(
$path
)
{
return
'/harbormaster/target/'
.
$path
;
}
protected
function
getBuiltinQueryNames
()
{
return
array
(
'all'
=>
pht
(
'All Targets'
),
);
}
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
$builds
,
PhabricatorSavedQuery
$query
,
array
$handles
)
{
assert_instances_of
(
$builds
,
'HarbormasterBuildTarget'
);
// Currently, this only supports the "harbormaster.target.search"
// API method.
throw
new
PhutilMethodNotImplementedException
();
}
}
Event Timeline
Log In to Comment