Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F17826395
DrydockBlueprintDatasource.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
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
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Jul 28, 7:15 AM (3 d, 5 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8246924
Default Alt Text
DrydockBlueprintDatasource.php (1 KB)
Attached To
Mode
rP Phabricator
Attached
Detach File
Event Timeline
Log In to Comment