1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-15 19:32:40 +01:00
phorge-phorge/src/applications/differential/controller/DifferentialInlineCommentPreviewController.php

45 lines
1.1 KiB
PHP
Raw Normal View History

2011-02-03 04:38:43 +01:00
<?php
final class DifferentialInlineCommentPreviewController
extends PhabricatorInlineCommentPreviewController {
2011-02-03 04:38:43 +01:00
protected function loadInlineComments() {
$viewer = $this->getViewer();
2011-02-03 04:38:43 +01:00
$revision = id(new DifferentialRevisionQuery())
->setViewer($viewer)
->withIDs(array($this->getRevisionID()))
->executeOne();
if (!$revision) {
return array();
}
return id(new DifferentialInlineCommentQuery())
->setViewer($this->getViewer())
->withDrafts(true)
->withAuthorPHIDs(array($viewer->getPHID()))
->withRevisionPHIDs(array($revision->getPHID()))
->needHidden(true)
->execute();
2011-02-03 04:38:43 +01:00
}
protected function loadObjectOwnerPHID() {
$viewer = $this->getViewer();
2011-02-03 04:38:43 +01:00
$revision = id(new DifferentialRevisionQuery())
->setViewer($viewer)
->withIDs(array($this->getRevisionID()))
->executeOne();
if (!$revision) {
return null;
}
2011-02-03 04:38:43 +01:00
return $revision->getAuthorPHID();
2011-02-03 04:38:43 +01:00
}
private function getRevisionID() {
return $this->getRequest()->getURIData('id');
}
2011-02-03 04:38:43 +01:00
}