3 final class DifferentialInlineComment
4 extends PhabricatorInlineComment
{
6 protected function newStorageObject() {
7 return new DifferentialTransactionComment();
10 public function getControllerURI() {
12 '/differential/comment/inline/edit/%s/',
13 $this->getRevisionID());
16 public function getTransactionCommentForSave() {
17 $content_source = PhabricatorContentSource
::newForSource(
18 PhabricatorOldWorldContentSource
::SOURCECONST
);
20 $this->getStorageObject()
21 ->setViewPolicy('public')
22 ->setEditPolicy($this->getAuthorPHID())
23 ->setContentSource($content_source)
24 ->attachIsHidden(false)
25 ->setCommentVersion(1);
27 return $this->getStorageObject();
30 public function supportsHiding() {
31 if ($this->getSyntheticAuthor()) {
37 public function isHidden() {
38 if (!$this->supportsHiding()) {
41 return $this->getStorageObject()->getIsHidden();
44 public static function newFromModernComment(
45 DifferentialTransactionComment
$comment) {
47 $obj = new DifferentialInlineComment();
48 $obj->setStorageObject($comment);
53 public function setChangesetID($id) {
54 $this->getStorageObject()->setChangesetID($id);
58 public function getChangesetID() {
59 return $this->getStorageObject()->getChangesetID();
62 public function setRevision(DifferentialRevision
$revision) {
63 $this->getStorageObject()->setRevisionPHID($revision->getPHID());
67 public function getRevisionPHID() {
68 return $this->getStorageObject()->getRevisionPHID();
71 // Although these are purely transitional, they're also *extra* dumb.
73 public function setRevisionID($revision_id) {
74 $revision = id(new DifferentialRevision())->load($revision_id);
75 return $this->setRevision($revision);
78 public function getRevisionID() {
79 $phid = $this->getStorageObject()->getRevisionPHID();
84 $revision = id(new DifferentialRevision())->loadOneWhere(
90 return $revision->getID();