Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/query/HarbormasterBuildQuery.php
Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | protected function didFilterPage(array $page) { | ||||
} | } | ||||
foreach ($page as $key => $build) { | foreach ($page as $key => $build) { | ||||
$plan_phid = $build->getBuildPlanPHID(); | $plan_phid = $build->getBuildPlanPHID(); | ||||
$build->attachBuildPlan(idx($plans, $plan_phid)); | $build->attachBuildPlan(idx($plans, $plan_phid)); | ||||
} | } | ||||
$build_phids = mpull($page, 'getPHID'); | $build_phids = mpull($page, 'getPHID'); | ||||
$messages = id(new HarbormasterBuildCommand())->loadAllWhere( | $messages = id(new HarbormasterBuildMessage())->loadAllWhere( | ||||
'targetPHID IN (%Ls) ORDER BY id ASC', | 'receiverPHID IN (%Ls) AND isConsumed = 0 ORDER BY id ASC', | ||||
$build_phids); | $build_phids); | ||||
$messages = mgroup($messages, 'getTargetPHID'); | $messages = mgroup($messages, 'getReceiverPHID'); | ||||
foreach ($page as $build) { | foreach ($page as $build) { | ||||
$unprocessed_messages = idx($messages, $build->getPHID(), array()); | $unprocessed_messages = idx($messages, $build->getPHID(), array()); | ||||
$build->attachUnprocessedMessages($unprocessed_messages); | $build->attachUnprocessedMessages($unprocessed_messages); | ||||
} | } | ||||
if ($this->needBuildTargets) { | if ($this->needBuildTargets) { | ||||
$targets = id(new HarbormasterBuildTargetQuery()) | $targets = id(new HarbormasterBuildTargetQuery()) | ||||
->setViewer($this->getViewer()) | ->setViewer($this->getViewer()) | ||||
▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines |