Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F71193456
DrydockLeaseDatasource.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, Jul 10, 05:30
Size
888 B
Mime Type
text/x-php
Expires
Fri, Jul 12, 05:30 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
18913382
Attached To
rPH Phabricator
DrydockLeaseDatasource.php
View Options
<?php
final
class
DrydockLeaseDatasource
extends
PhabricatorTypeaheadDatasource
{
public
function
getPlaceholderText
()
{
return
pht
(
'Type a lease ID (exact match)...'
);
}
public
function
getDatasourceApplicationClass
()
{
return
'PhabricatorDrydockApplication'
;
}
public
function
loadResults
()
{
$viewer
=
$this
->
getViewer
();
$raw_query
=
$this
->
getRawQuery
();
$leases
=
id
(
new
DrydockLeaseQuery
())
->
setViewer
(
$viewer
)
->
withDatasourceQuery
(
$raw_query
)
->
execute
();
$handles
=
id
(
new
PhabricatorHandleQuery
())
->
setViewer
(
$viewer
)
->
withPHIDs
(
mpull
(
$leases
,
'getPHID'
))
->
execute
();
$results
=
array
();
foreach
(
$handles
as
$handle
)
{
$results
[]
=
id
(
new
PhabricatorTypeaheadResult
())
->
setName
(
$handle
->
getName
())
->
setPHID
(
$handle
->
getPHID
());
}
return
$results
;
}
}
Event Timeline
Log In to Comment