Differential D12026 Diff 28957 src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | foreach ($xactions as $xaction) { | ||||
$xaction->attachViewer($this->getViewer()); | $xaction->attachViewer($this->getViewer()); | ||||
} | } | ||||
if ($this->needComments) { | if ($this->needComments) { | ||||
$comment_phids = array_filter(mpull($xactions, 'getCommentPHID')); | $comment_phids = array_filter(mpull($xactions, 'getCommentPHID')); | ||||
$comments = array(); | $comments = array(); | ||||
if ($comment_phids) { | if ($comment_phids) { | ||||
$comments = id(new PhabricatorApplicationTransactionCommentQuery()) | $comments = | ||||
id(new PhabricatorApplicationTransactionTemplatedCommentQuery()) | |||||
->setTemplate($table->getApplicationTransactionCommentObject()) | ->setTemplate($table->getApplicationTransactionCommentObject()) | ||||
->setViewer($this->getViewer()) | ->setViewer($this->getViewer()) | ||||
->withPHIDs($comment_phids) | ->withPHIDs($comment_phids) | ||||
->execute(); | ->execute(); | ||||
$comments = mpull($comments, null, 'getPHID'); | $comments = mpull($comments, null, 'getPHID'); | ||||
} | } | ||||
foreach ($xactions as $xaction) { | foreach ($xactions as $xaction) { | ||||
if ($xaction->getCommentPHID()) { | if ($xaction->getCommentPHID()) { | ||||
$comment = idx($comments, $xaction->getCommentPHID()); | $comment = idx($comments, $xaction->getCommentPHID()); | ||||
if ($comment) { | if ($comment) { | ||||
$xaction->attachComment($comment); | $xaction->attachComment($comment); | ||||
▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines |