Path: blob/master/src/applications/audit/storage/PhabricatorAuditTransactionComment.php
12256 views
<?php12final class PhabricatorAuditTransactionComment3extends PhabricatorApplicationTransactionComment4implements5PhabricatorInlineCommentInterface {67protected $commitPHID;8protected $pathID;9protected $isNewFile = 0;10protected $lineNumber = 0;11protected $lineLength = 0;12protected $fixedState;13protected $hasReplies = 0;14protected $replyToCommentPHID;15protected $legacyCommentID;16protected $attributes = array();1718private $replyToComment = self::ATTACHABLE;19private $inlineContext = self::ATTACHABLE;2021public function getApplicationTransactionObject() {22return new PhabricatorAuditTransaction();23}2425public function shouldUseMarkupCache($field) {26// Only cache submitted comments.27return ($this->getTransactionPHID() != null);28}2930protected function getConfiguration() {31$config = parent::getConfiguration();3233$config[self::CONFIG_COLUMN_SCHEMA] = array(34'commitPHID' => 'phid?',35'pathID' => 'id?',36'isNewFile' => 'bool',37'lineNumber' => 'uint32',38'lineLength' => 'uint32',39'fixedState' => 'text12?',40'hasReplies' => 'bool',41'replyToCommentPHID' => 'phid?',42'legacyCommentID' => 'id?',43) + $config[self::CONFIG_COLUMN_SCHEMA];4445$config[self::CONFIG_KEY_SCHEMA] = array(46'key_path' => array(47'columns' => array('pathID'),48),49'key_draft' => array(50'columns' => array('authorPHID', 'transactionPHID'),51),52'key_commit' => array(53'columns' => array('commitPHID'),54),55'key_legacy' => array(56'columns' => array('legacyCommentID'),57),58) + $config[self::CONFIG_KEY_SCHEMA];5960$config[self::CONFIG_SERIALIZATION] = array(61'attributes' => self::SERIALIZATION_JSON,62) + idx($config, self::CONFIG_SERIALIZATION, array());6364return $config;65}6667public function attachReplyToComment(68PhabricatorAuditTransactionComment $comment = null) {69$this->replyToComment = $comment;70return $this;71}7273public function getReplyToComment() {74return $this->assertAttached($this->replyToComment);75}7677public function getAttribute($key, $default = null) {78return idx($this->attributes, $key, $default);79}8081public function setAttribute($key, $value) {82$this->attributes[$key] = $value;83return $this;84}8586public function newInlineCommentObject() {87return PhabricatorAuditInlineComment::newFromModernComment($this);88}8990public function getInlineContext() {91return $this->assertAttached($this->inlineContext);92}9394public function attachInlineContext(95PhabricatorInlineCommentContext $context = null) {96$this->inlineContext = $context;97return $this;98}99100}101102103