Differential D20180 Diff 48209 src/applications/harbormaster/query/HarbormasterBuildUnitMessageQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/query/HarbormasterBuildUnitMessageQuery.php
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | if ($this->targetPHIDs !== null) { | ||||
$conn, | $conn, | ||||
'buildTargetPHID in (%Ls)', | 'buildTargetPHID in (%Ls)', | ||||
$this->targetPHIDs); | $this->targetPHIDs); | ||||
} | } | ||||
return $where; | return $where; | ||||
} | } | ||||
protected function didFilterPage(array $messages) { | |||||
$indexes = array(); | |||||
foreach ($messages as $message) { | |||||
$index = $message->getNameIndex(); | |||||
if (strlen($index)) { | |||||
$indexes[$index] = $index; | |||||
} | |||||
} | |||||
if ($indexes) { | |||||
$map = HarbormasterString::newIndexMap($indexes); | |||||
foreach ($messages as $message) { | |||||
$index = $message->getNameIndex(); | |||||
if (!strlen($index)) { | |||||
continue; | |||||
} | |||||
$name = idx($map, $index); | |||||
if ($name === null) { | |||||
$name = pht('Unknown Unit Message ("%s")', $index); | |||||
} | |||||
$message->setName($name); | |||||
} | |||||
} | |||||
return $messages; | |||||
} | |||||
public function getQueryApplicationClass() { | public function getQueryApplicationClass() { | ||||
return 'PhabricatorHarbormasterApplication'; | return 'PhabricatorHarbormasterApplication'; | ||||
} | } | ||||
} | } |