Path: blob/master/src/applications/differential/storage/DifferentialInlineComment.php
12256 views
<?php12final class DifferentialInlineComment3extends PhabricatorInlineComment {45protected function newStorageObject() {6return new DifferentialTransactionComment();7}89public function getControllerURI() {10return urisprintf(11'/differential/comment/inline/edit/%s/',12$this->getRevisionID());13}1415public function getTransactionCommentForSave() {16$content_source = PhabricatorContentSource::newForSource(17PhabricatorOldWorldContentSource::SOURCECONST);1819$this->getStorageObject()20->setViewPolicy('public')21->setEditPolicy($this->getAuthorPHID())22->setContentSource($content_source)23->attachIsHidden(false)24->setCommentVersion(1);2526return $this->getStorageObject();27}2829public function supportsHiding() {30if ($this->getSyntheticAuthor()) {31return false;32}33return true;34}3536public function isHidden() {37if (!$this->supportsHiding()) {38return false;39}40return $this->getStorageObject()->getIsHidden();41}4243public static function newFromModernComment(44DifferentialTransactionComment $comment) {4546$obj = new DifferentialInlineComment();47$obj->setStorageObject($comment);4849return $obj;50}5152public function setChangesetID($id) {53$this->getStorageObject()->setChangesetID($id);54return $this;55}5657public function getChangesetID() {58return $this->getStorageObject()->getChangesetID();59}6061public function setRevision(DifferentialRevision $revision) {62$this->getStorageObject()->setRevisionPHID($revision->getPHID());63return $this;64}6566public function getRevisionPHID() {67return $this->getStorageObject()->getRevisionPHID();68}6970// Although these are purely transitional, they're also *extra* dumb.7172public function setRevisionID($revision_id) {73$revision = id(new DifferentialRevision())->load($revision_id);74return $this->setRevision($revision);75}7677public function getRevisionID() {78$phid = $this->getStorageObject()->getRevisionPHID();79if (!$phid) {80return null;81}8283$revision = id(new DifferentialRevision())->loadOneWhere(84'phid = %s',85$phid);86if (!$revision) {87return null;88}89return $revision->getID();90}9192}939495