Differential D12186 Diff 29293 src/applications/differential/controller/DifferentialInlineCommentPreviewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/controller/DifferentialInlineCommentPreviewController.php
| <?php | <?php | ||||
| final class DifferentialInlineCommentPreviewController | final class DifferentialInlineCommentPreviewController | ||||
| extends PhabricatorInlineCommentPreviewController { | extends PhabricatorInlineCommentPreviewController { | ||||
| private $revisionID; | protected function loadInlineComments() { | ||||
| $viewer = $this->getViewer(); | |||||
| public function willProcessRequest(array $data) { | return id(new DifferentialInlineCommentQuery()) | ||||
| $this->revisionID = $data['id']; | ->withDraftComments($viewer->getPHID(), $this->getRevisionID()) | ||||
| ->execute(); | |||||
| } | } | ||||
| protected function loadInlineComments() { | protected function loadObjectOwnerPHID() { | ||||
| $user = $this->getRequest()->getUser(); | $viewer = $this->getViewer(); | ||||
| $inlines = id(new DifferentialInlineCommentQuery()) | $revision = id(new DifferentialRevisionQuery()) | ||||
| ->withDraftComments($user->getPHID(), $this->revisionID) | ->setViewer($viewer) | ||||
| ->execute(); | ->withIDs(array($this->getRevisionID())) | ||||
| ->executeOne(); | |||||
| if (!$revision) { | |||||
| return null; | |||||
| } | |||||
| return $inlines; | return $revision->getAuthorPHID(); | ||||
| } | } | ||||
| private function getRevisionID() { | |||||
| return $this->getRequest()->getURIData('id'); | |||||
| } | |||||
| } | } | ||||