Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/diff/PhabricatorInlineCommentController.php
Show First 20 Lines • Show All 324 Lines • ▼ Show 20 Lines | public static function loadAndAttachReplies( | ||||
foreach ($comments as $comment) { | foreach ($comments as $comment) { | ||||
$reply_phid = $comment->getReplyToCommentPHID(); | $reply_phid = $comment->getReplyToCommentPHID(); | ||||
if ($reply_phid) { | if ($reply_phid) { | ||||
$reply_phids[] = $reply_phid; | $reply_phids[] = $reply_phid; | ||||
} | } | ||||
} | } | ||||
if ($reply_phids) { | if ($reply_phids) { | ||||
$reply_comments = id(new PhabricatorApplicationTransactionCommentQuery()) | $reply_comments = | ||||
id(new PhabricatorApplicationTransactionTemplatedCommentQuery()) | |||||
->setTemplate($template) | ->setTemplate($template) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withPHIDs($reply_phids) | ->withPHIDs($reply_phids) | ||||
->execute(); | ->execute(); | ||||
$reply_comments = mpull($reply_comments, null, 'getPHID'); | $reply_comments = mpull($reply_comments, null, 'getPHID'); | ||||
} else { | } else { | ||||
$reply_comments = array(); | $reply_comments = array(); | ||||
} | } | ||||
foreach ($comments as $comment) { | foreach ($comments as $comment) { | ||||
$reply_phid = $comment->getReplyToCommentPHID(); | $reply_phid = $comment->getReplyToCommentPHID(); | ||||
$reply = idx($reply_comments, $reply_phid); | $reply = idx($reply_comments, $reply_phid); | ||||
$comment->attachReplyToComment($reply); | $comment->attachReplyToComment($reply); | ||||
} | } | ||||
return $comments; | return $comments; | ||||
} | } | ||||
} | } |