Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F82146684
DrydockBlueprintDatasource.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
Mon, Sep 9, 20:36
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Sep 11, 20:36 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
20658725
Attached To
rPH Phabricator
DrydockBlueprintDatasource.php
View Options
<?php
final
class
DrydockBlueprintDatasource
extends
PhabricatorTypeaheadDatasource
{
public
function
getPlaceholderText
()
{
return
pht
(
'Type a blueprint name...'
);
}
public
function
getBrowseTitle
()
{
return
pht
(
'Browse Blueprints'
);
}
public
function
getDatasourceApplicationClass
()
{
return
'PhabricatorDrydockApplication'
;
}
public
function
loadResults
()
{
$viewer
=
$this
->
getViewer
();
$raw_query
=
$this
->
getRawQuery
();
$blueprints
=
id
(
new
DrydockBlueprintQuery
())
->
setViewer
(
$viewer
)
->
withDatasourceQuery
(
$raw_query
)
->
execute
();
$handles
=
id
(
new
PhabricatorHandleQuery
())
->
setViewer
(
$viewer
)
->
withPHIDs
(
mpull
(
$blueprints
,
'getPHID'
))
->
execute
();
$results
=
array
();
foreach
(
$blueprints
as
$blueprint
)
{
$handle
=
$handles
[
$blueprint
->
getPHID
()];
$result
=
id
(
new
PhabricatorTypeaheadResult
())
->
setName
(
$handle
->
getFullName
())
->
setPHID
(
$handle
->
getPHID
());
if
(
$blueprint
->
getIsDisabled
())
{
$result
->
setClosed
(
pht
(
'Disabled'
));
}
$result
->
addAttribute
(
$blueprint
->
getImplementation
()->
getBlueprintName
());
$results
[]
=
$result
;
}
return
$results
;
}
}
Event Timeline
Log In to Comment