Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/query/DifferentialTransactionQuery.php
| Show All 19 Lines | public static function loadUnsubmittedInlineComments( | ||||
| $table = new DifferentialTransactionComment(); | $table = new DifferentialTransactionComment(); | ||||
| $conn_r = $table->establishConnection('r'); | $conn_r = $table->establishConnection('r'); | ||||
| $phids = queryfx_all( | $phids = queryfx_all( | ||||
| $conn_r, | $conn_r, | ||||
| 'SELECT phid FROM %T | 'SELECT phid FROM %T | ||||
| WHERE revisionPHID = %s | WHERE revisionPHID = %s | ||||
| AND authorPHID = %s | AND authorPHID = %s | ||||
| AND transactionPHID IS NULL', | AND transactionPHID IS NULL | ||||
| AND isDeleted = 0', | |||||
| $table->getTableName(), | $table->getTableName(), | ||||
| $revision->getPHID(), | $revision->getPHID(), | ||||
| $viewer->getPHID()); | $viewer->getPHID()); | ||||
| $phids = ipull($phids, 'phid'); | $phids = ipull($phids, 'phid'); | ||||
| if (!$phids) { | if (!$phids) { | ||||
| return array(); | return array(); | ||||
| } | } | ||||
| return id(new PhabricatorApplicationTransactionCommentQuery()) | $comments = id(new PhabricatorApplicationTransactionCommentQuery()) | ||||
| ->setTemplate(new DifferentialTransactionComment()) | ->setTemplate(new DifferentialTransactionComment()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->withPHIDs($phids) | ->withPHIDs($phids) | ||||
| ->execute(); | ->execute(); | ||||
| $comments = PhabricatorInlineCommentController::loadAndAttachReplies( | |||||
| $viewer, | |||||
| $comments); | |||||
| return $comments; | |||||
| } | } | ||||
| } | } | ||||