Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F12660929
ArcanistRevisionBuildableHardpointQuery.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
ArcanistRevisionBuildableHardpointQuery.php
View Options
<?php
final
class
ArcanistRevisionBuildableHardpointQuery
extends
ArcanistRuntimeHardpointQuery
{
public
function
getHardpoints
()
{
return
array
(
ArcanistRevisionRef
::
HARDPOINT_BUILDABLEREF
,
);
}
protected
function
canLoadRef
(
ArcanistRef
$ref
)
{
return
(
$ref
instanceof
ArcanistRevisionRef
);
}
public
function
loadHardpoint
(
array
$refs
,
$hardpoint
)
{
$diff_map
=
array
();
foreach
(
$refs
as
$key
=>
$revision_ref
)
{
$diff_phid
=
$revision_ref
->
getDiffPHID
();
if
(
$diff_phid
)
{
$diff_map
[
$key
]
=
$diff_phid
;
}
}
if
(!
$diff_map
)
{
yield
$this
->
yieldValue
(
$refs
,
null
);
}
$buildables
=
(
yield
$this
->
yieldConduitSearch
(
'harbormaster.buildable.search'
,
array
(
'objectPHIDs'
=>
array_values
(
$diff_map
),
'manual'
=>
false
,
)));
$buildable_refs
=
array
();
foreach
(
$buildables
as
$buildable
)
{
$buildable_ref
=
ArcanistBuildableRef
::
newFromConduit
(
$buildable
);
$object_phid
=
$buildable_ref
->
getObjectPHID
();
$buildable_refs
[
$object_phid
]
=
$buildable_ref
;
}
$results
=
array_fill_keys
(
array_keys
(
$refs
),
null
);
foreach
(
$refs
as
$key
=>
$revision_ref
)
{
if
(!
isset
(
$diff_map
[
$key
]))
{
continue
;
}
$diff_phid
=
$diff_map
[
$key
];
if
(!
isset
(
$buildable_refs
[
$diff_phid
]))
{
continue
;
}
$results
[
$key
]
=
$buildable_refs
[
$diff_phid
];
}
yield
$this
->
yieldMap
(
$results
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Nov 28, 15:42 (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1039540
Default Alt Text
ArcanistRevisionBuildableHardpointQuery.php (1 KB)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline
Log In to Comment