Page MenuHomePhabricator

D21230.diff
No OneTemporary

D21230.diff

diff --git a/src/applications/audit/storage/PhabricatorAuditInlineComment.php b/src/applications/audit/storage/PhabricatorAuditInlineComment.php
--- a/src/applications/audit/storage/PhabricatorAuditInlineComment.php
+++ b/src/applications/audit/storage/PhabricatorAuditInlineComment.php
@@ -34,49 +34,6 @@
return $this->getStorageObject();
}
- public static function loadID($id) {
- $inlines = id(new PhabricatorAuditTransactionComment())->loadAllWhere(
- 'id = %d',
- $id);
- if (!$inlines) {
- return null;
- }
-
- return head(self::buildProxies($inlines));
- }
-
- public static function loadPHID($phid) {
- $inlines = id(new PhabricatorAuditTransactionComment())->loadAllWhere(
- 'phid = %s',
- $phid);
- if (!$inlines) {
- return null;
- }
- return head(self::buildProxies($inlines));
- }
-
- public static function loadPublishedComments(
- PhabricatorUser $viewer,
- $commit_phid) {
-
- $inlines = id(new DiffusionDiffInlineCommentQuery())
- ->setViewer($viewer)
- ->withCommitPHIDs(array($commit_phid))
- ->withHasTransaction(true)
- ->execute();
-
- return self::buildProxies($inlines);
- }
-
- private static function buildProxies(array $inlines) {
- $results = array();
- foreach ($inlines as $key => $inline) {
- $results[$key] = self::newFromModernComment(
- $inline);
- }
- return $results;
- }
-
public static function newFromModernComment(
PhabricatorAuditTransactionComment $comment) {
diff --git a/src/applications/diffusion/controller/DiffusionInlineCommentController.php b/src/applications/diffusion/controller/DiffusionInlineCommentController.php
--- a/src/applications/diffusion/controller/DiffusionInlineCommentController.php
+++ b/src/applications/diffusion/controller/DiffusionInlineCommentController.php
@@ -42,11 +42,31 @@
}
protected function loadComment($id) {
- return PhabricatorAuditInlineComment::loadID($id);
+ $viewer = $this->getViewer();
+ $inline = id(new DiffusionDiffInlineCommentQuery())
+ ->setViewer($viewer)
+ ->withIDs(array($id))
+ ->executeOne();
+
+ if ($inline) {
+ $inline = $inline->newInlineCommentObject();
+ }
+
+ return $inline;
}
protected function loadCommentByPHID($phid) {
- return PhabricatorAuditInlineComment::loadPHID($phid);
+ $viewer = $this->getViewer();
+ $inline = id(new DiffusionDiffInlineCommentQuery())
+ ->setViewer($viewer)
+ ->withPHIDs(array($phid))
+ ->executeOne();
+
+ if ($inline) {
+ $inline = $inline->newInlineCommentObject();
+ }
+
+ return $inline;
}
protected function loadCommentForEdit($id) {

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 8, 12:21 PM (3 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7382286
Default Alt Text
D21230.diff (2 KB)

Event Timeline