Differential D21279 Diff 50664 src/applications/differential/query/DifferentialDiffInlineCommentQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/query/DifferentialDiffInlineCommentQuery.php
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | $rows = queryfx_all( | ||||
mpull($comments, 'getID')); | mpull($comments, 'getID')); | ||||
$id_map = ipull($rows, 'commentID'); | $id_map = ipull($rows, 'commentID'); | ||||
$id_map = array_fuse($id_map); | $id_map = array_fuse($id_map); | ||||
return $id_map; | return $id_map; | ||||
} | } | ||||
protected function newInlineContextFromCacheData(array $map) { | |||||
return PhabricatorDiffInlineCommentContext::newFromCacheData($map); | |||||
} | |||||
protected function newInlineContextMap(array $inlines) { | protected function newInlineContextMap(array $inlines) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$map = array(); | $map = array(); | ||||
foreach ($inlines as $key => $inline) { | $changeset_ids = mpull($inlines, 'getChangesetID'); | ||||
$changeset = id(new DifferentialChangesetQuery()) | |||||
$changesets = id(new DifferentialChangesetQuery()) | |||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withIDs(array($inline->getChangesetID())) | ->withIDs($changeset_ids) | ||||
->needHunks(true) | ->needHunks(true) | ||||
->executeOne(); | ->execute(); | ||||
$changesets = mpull($changesets, null, 'getID'); | |||||
foreach ($inlines as $key => $inline) { | |||||
$changeset = idx($changesets, $inline->getChangesetID()); | |||||
if (!$changeset) { | if (!$changeset) { | ||||
continue; | continue; | ||||
} | } | ||||
$hunks = $changeset->getHunks(); | $hunks = $changeset->getHunks(); | ||||
$is_simple = | $is_simple = | ||||
(count($hunks) === 1) && | (count($hunks) === 1) && | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |