Changeset View
Changeset View
Standalone View
Standalone View
src/applications/audit/storage/PhabricatorAuditInlineComment.php
| Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | final class PhabricatorAuditInlineComment | ||||
| } | } | ||||
| public static function loadDraftComments( | public static function loadDraftComments( | ||||
| PhabricatorUser $viewer, | PhabricatorUser $viewer, | ||||
| $commit_phid) { | $commit_phid) { | ||||
| $inlines = id(new PhabricatorAuditTransactionComment())->loadAllWhere( | $inlines = id(new PhabricatorAuditTransactionComment())->loadAllWhere( | ||||
| 'authorPHID = %s AND commitPHID = %s AND transactionPHID IS NULL | 'authorPHID = %s AND commitPHID = %s AND transactionPHID IS NULL | ||||
| AND pathID IS NOT NULL', | AND pathID IS NOT NULL | ||||
| AND isDeleted = 0', | |||||
| $viewer->getPHID(), | $viewer->getPHID(), | ||||
| $commit_phid); | $commit_phid); | ||||
| $inlines = PhabricatorInlineCommentController::loadAndAttachReplies( | |||||
| $viewer, | |||||
| $inlines); | |||||
| return self::buildProxies($inlines); | return self::buildProxies($inlines); | ||||
| } | } | ||||
| public static function loadPublishedComments( | public static function loadPublishedComments( | ||||
| PhabricatorUser $viewer, | PhabricatorUser $viewer, | ||||
| $commit_phid) { | $commit_phid) { | ||||
| $inlines = id(new PhabricatorAuditTransactionComment())->loadAllWhere( | $inlines = id(new PhabricatorAuditTransactionComment())->loadAllWhere( | ||||
| Show All 13 Lines | if ($path_id === null) { | ||||
| $inlines = id(new PhabricatorAuditTransactionComment())->loadAllWhere( | $inlines = id(new PhabricatorAuditTransactionComment())->loadAllWhere( | ||||
| 'commitPHID = %s AND (transactionPHID IS NOT NULL OR authorPHID = %s) | 'commitPHID = %s AND (transactionPHID IS NOT NULL OR authorPHID = %s) | ||||
| AND pathID IS NOT NULL', | AND pathID IS NOT NULL', | ||||
| $commit_phid, | $commit_phid, | ||||
| $viewer->getPHID()); | $viewer->getPHID()); | ||||
| } else { | } else { | ||||
| $inlines = id(new PhabricatorAuditTransactionComment())->loadAllWhere( | $inlines = id(new PhabricatorAuditTransactionComment())->loadAllWhere( | ||||
| 'commitPHID = %s AND pathID = %d AND | 'commitPHID = %s AND pathID = %d AND | ||||
| (authorPHID = %s OR transactionPHID IS NOT NULL)', | ((authorPHID = %s AND isDeleted = 0) OR transactionPHID IS NOT NULL)', | ||||
| $commit_phid, | $commit_phid, | ||||
| $path_id, | $path_id, | ||||
| $viewer->getPHID()); | $viewer->getPHID()); | ||||
| } | } | ||||
| return self::buildProxies($inlines); | return self::buildProxies($inlines); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 205 Lines • Show Last 20 Lines | |||||