2014-07-25 02:59:43 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorAuditTransactionComment
|
|
|
|
extends PhabricatorApplicationTransactionComment {
|
|
|
|
|
|
|
|
protected $commitPHID;
|
|
|
|
protected $pathID;
|
|
|
|
protected $isNewFile = 0;
|
|
|
|
protected $lineNumber = 0;
|
|
|
|
protected $lineLength = 0;
|
|
|
|
protected $fixedState;
|
|
|
|
protected $hasReplies = 0;
|
|
|
|
protected $replyToCommentPHID;
|
|
|
|
protected $legacyCommentID;
|
|
|
|
|
2015-03-09 19:51:26 +01:00
|
|
|
private $replyToComment = self::ATTACHABLE;
|
|
|
|
|
2014-07-25 02:59:43 +02:00
|
|
|
public function getApplicationTransactionObject() {
|
|
|
|
return new PhabricatorAuditTransaction();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function shouldUseMarkupCache($field) {
|
|
|
|
// Only cache submitted comments.
|
|
|
|
return ($this->getTransactionPHID() != null);
|
|
|
|
}
|
|
|
|
|
2015-01-13 20:47:05 +01:00
|
|
|
protected function getConfiguration() {
|
2014-09-18 17:32:44 +02:00
|
|
|
$config = parent::getConfiguration();
|
2014-10-01 16:53:50 +02:00
|
|
|
|
2014-09-18 17:32:44 +02:00
|
|
|
$config[self::CONFIG_COLUMN_SCHEMA] = array(
|
|
|
|
'commitPHID' => 'phid?',
|
|
|
|
'pathID' => 'id?',
|
|
|
|
'isNewFile' => 'bool',
|
|
|
|
'lineNumber' => 'uint32',
|
|
|
|
'lineLength' => 'uint32',
|
|
|
|
'fixedState' => 'text12?',
|
|
|
|
'hasReplies' => 'bool',
|
|
|
|
'replyToCommentPHID' => 'phid?',
|
|
|
|
'legacyCommentID' => 'id?',
|
|
|
|
) + $config[self::CONFIG_COLUMN_SCHEMA];
|
2014-10-01 16:53:50 +02:00
|
|
|
|
|
|
|
$config[self::CONFIG_KEY_SCHEMA] = array(
|
|
|
|
'key_path' => array(
|
|
|
|
'columns' => array('pathID'),
|
|
|
|
),
|
|
|
|
'key_draft' => array(
|
|
|
|
'columns' => array('authorPHID', 'transactionPHID'),
|
|
|
|
),
|
|
|
|
'key_commit' => array(
|
|
|
|
'columns' => array('commitPHID'),
|
|
|
|
),
|
|
|
|
'key_legacy' => array(
|
|
|
|
'columns' => array('legacyCommentID'),
|
|
|
|
),
|
|
|
|
) + $config[self::CONFIG_KEY_SCHEMA];
|
|
|
|
|
2014-09-18 17:32:44 +02:00
|
|
|
return $config;
|
|
|
|
}
|
|
|
|
|
2015-03-09 19:51:26 +01:00
|
|
|
public function attachReplyToComment(
|
|
|
|
PhabricatorAuditTransactionComment $comment = null) {
|
|
|
|
$this->replyToComment = $comment;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getReplyToComment() {
|
|
|
|
return $this->assertAttached($this->replyToComment);
|
|
|
|
}
|
|
|
|
|
2014-07-25 02:59:43 +02:00
|
|
|
}
|