Changeset View
Changeset View
Standalone View
Standalone View
src/applications/drydock/typeahead/DrydockBlueprintDatasource.php
Show All 20 Lines | $blueprints = id(new DrydockBlueprintQuery()) | ||||
->execute(); | ->execute(); | ||||
$handles = id(new PhabricatorHandleQuery()) | $handles = id(new PhabricatorHandleQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withPHIDs(mpull($blueprints, 'getPHID')) | ->withPHIDs(mpull($blueprints, 'getPHID')) | ||||
->execute(); | ->execute(); | ||||
$results = array(); | $results = array(); | ||||
foreach ($handles as $handle) { | foreach ($blueprints as $blueprint) { | ||||
$results[] = id(new PhabricatorTypeaheadResult()) | $handle = $handles[$blueprint->getPHID()]; | ||||
->setName($handle->getName()) | |||||
$result = id(new PhabricatorTypeaheadResult()) | |||||
->setName($handle->getFullName()) | |||||
->setPHID($handle->getPHID()); | ->setPHID($handle->getPHID()); | ||||
if ($blueprint->getIsDisabled()) { | |||||
$result->setClosed(pht('Disabled')); | |||||
} | } | ||||
$results[] = $result; | |||||
} | |||||
return $results; | return $results; | ||||
} | } | ||||
} | } |