Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/controller/DifferentialController.php
Show First 20 Lines • Show All 186 Lines • ▼ Show 20 Lines | protected function loadHarbormasterData(array $diffs) { | ||||
$target_map = array(); | $target_map = array(); | ||||
foreach ($diffs as $phid => $diff) { | foreach ($diffs as $phid => $diff) { | ||||
$target_map[$phid] = $diff->getBuildTargetPHIDs(); | $target_map[$phid] = $diff->getBuildTargetPHIDs(); | ||||
} | } | ||||
$all_target_phids = array_mergev($target_map); | $all_target_phids = array_mergev($target_map); | ||||
if ($all_target_phids) { | if ($all_target_phids) { | ||||
$unit_messages = id(new HarbormasterBuildUnitMessage())->loadAllWhere( | $unit_messages = id(new HarbormasterBuildUnitMessageQuery()) | ||||
'buildTargetPHID IN (%Ls)', | ->setViewer($viewer) | ||||
$all_target_phids); | ->withBuildTargetPHIDs($all_target_phids) | ||||
->execute(); | |||||
$unit_messages = mgroup($unit_messages, 'getBuildTargetPHID'); | $unit_messages = mgroup($unit_messages, 'getBuildTargetPHID'); | ||||
} else { | } else { | ||||
$unit_messages = array(); | $unit_messages = array(); | ||||
} | } | ||||
foreach ($diffs as $phid => $diff) { | foreach ($diffs as $phid => $diff) { | ||||
$target_phids = idx($target_map, $phid, array()); | $target_phids = idx($target_map, $phid, array()); | ||||
$messages = array_select_keys($unit_messages, $target_phids); | $messages = array_select_keys($unit_messages, $target_phids); | ||||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |