Changeset View
Changeset View
Standalone View
Standalone View
src/applications/almanac/typeahead/AlmanacInterfaceDatasource.php
Show All 40 Lines | if ($interfaces) { | ||||
->withPHIDs(mpull($interfaces, 'getPHID')) | ->withPHIDs(mpull($interfaces, 'getPHID')) | ||||
->execute(); | ->execute(); | ||||
} else { | } else { | ||||
$handles = array(); | $handles = array(); | ||||
} | } | ||||
$results = array(); | $results = array(); | ||||
foreach ($handles as $handle) { | foreach ($handles as $handle) { | ||||
if ($handle->isClosed()) { | |||||
$closed = pht('Disabled'); | |||||
} else { | |||||
$closed = null; | |||||
} | |||||
$results[] = id(new PhabricatorTypeaheadResult()) | $results[] = id(new PhabricatorTypeaheadResult()) | ||||
->setName($handle->getName()) | ->setName($handle->getName()) | ||||
->setPHID($handle->getPHID()); | ->setPHID($handle->getPHID()) | ||||
->setClosed($closed); | |||||
} | } | ||||
return $results; | return $results; | ||||
} | } | ||||
} | } |