2011-02-03 04:38:43 +01:00
|
|
|
<?php
|
|
|
|
|
2012-03-10 00:46:25 +01:00
|
|
|
final class DifferentialInlineCommentPreviewController
|
2012-07-23 20:01:28 +02:00
|
|
|
extends PhabricatorInlineCommentPreviewController {
|
2011-02-03 04:38:43 +01:00
|
|
|
|
2015-03-28 01:08:31 +01:00
|
|
|
protected function loadInlineComments() {
|
|
|
|
$viewer = $this->getViewer();
|
2011-02-03 04:38:43 +01:00
|
|
|
|
2015-04-20 23:33:58 +02:00
|
|
|
$revision = id(new DifferentialRevisionQuery())
|
|
|
|
->setViewer($viewer)
|
|
|
|
->withIDs(array($this->getRevisionID()))
|
|
|
|
->executeOne();
|
|
|
|
if (!$revision) {
|
|
|
|
return array();
|
|
|
|
}
|
|
|
|
|
2015-03-28 01:08:31 +01:00
|
|
|
return id(new DifferentialInlineCommentQuery())
|
2015-04-20 23:33:58 +02:00
|
|
|
->setViewer($this->getViewer())
|
|
|
|
->withDrafts(true)
|
|
|
|
->withAuthorPHIDs(array($viewer->getPHID()))
|
|
|
|
->withRevisionPHIDs(array($revision->getPHID()))
|
2015-03-28 01:08:31 +01:00
|
|
|
->execute();
|
2011-02-03 04:38:43 +01:00
|
|
|
}
|
|
|
|
|
2015-03-28 01:08:31 +01:00
|
|
|
protected function loadObjectOwnerPHID() {
|
|
|
|
$viewer = $this->getViewer();
|
2011-02-03 04:38:43 +01:00
|
|
|
|
2015-03-28 01:08:31 +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
|
|
|
|
2015-03-28 01:08:31 +01:00
|
|
|
return $revision->getAuthorPHID();
|
2011-02-03 04:38:43 +01:00
|
|
|
}
|
|
|
|
|
2015-03-28 01:08:31 +01:00
|
|
|
|
|
|
|
private function getRevisionID() {
|
|
|
|
return $this->getRequest()->getURIData('id');
|
|
|
|
}
|
2011-02-03 04:38:43 +01:00
|
|
|
}
|