Differential D19507 Diff 46647 src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | protected function execute(ConduitAPIRequest $request) { | ||||
$with_phids = idx($constraints, 'phids'); | $with_phids = idx($constraints, 'phids'); | ||||
if ($with_phids) { | if ($with_phids) { | ||||
$xaction_query->withPHIDs($with_phids); | $xaction_query->withPHIDs($with_phids); | ||||
} | } | ||||
$xactions = $xaction_query->executeWithCursorPager($pager); | $xactions = $xaction_query->executeWithCursorPager($pager); | ||||
$comment_map = array(); | |||||
if ($xactions) { | if ($xactions) { | ||||
$template = head($xactions)->getApplicationTransactionCommentObject(); | $template = head($xactions)->getApplicationTransactionCommentObject(); | ||||
if ($template) { | |||||
$query = new PhabricatorApplicationTransactionTemplatedCommentQuery(); | $query = new PhabricatorApplicationTransactionTemplatedCommentQuery(); | ||||
$comment_map = $query | $comment_map = $query | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->setTemplate($template) | ->setTemplate($template) | ||||
->withTransactionPHIDs(mpull($xactions, 'getPHID')) | ->withTransactionPHIDs(mpull($xactions, 'getPHID')) | ||||
->execute(); | ->execute(); | ||||
$comment_map = msort($comment_map, 'getCommentVersion'); | $comment_map = msort($comment_map, 'getCommentVersion'); | ||||
$comment_map = array_reverse($comment_map); | $comment_map = array_reverse($comment_map); | ||||
$comment_map = mgroup($comment_map, 'getTransactionPHID'); | $comment_map = mgroup($comment_map, 'getTransactionPHID'); | ||||
} else { | } | ||||
$comment_map = array(); | |||||
} | } | ||||
$modular_classes = array(); | $modular_classes = array(); | ||||
$modular_objects = array(); | $modular_objects = array(); | ||||
$modular_xactions = array(); | $modular_xactions = array(); | ||||
foreach ($xactions as $xaction) { | foreach ($xactions as $xaction) { | ||||
if (!$xaction instanceof PhabricatorModularTransaction) { | if (!$xaction instanceof PhabricatorModularTransaction) { | ||||
continue; | continue; | ||||
▲ Show 20 Lines • Show All 122 Lines • Show Last 20 Lines |