2013-07-03 20:15:45 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class LegalpadTransactionComment
|
|
|
|
extends PhabricatorApplicationTransactionComment {
|
|
|
|
|
|
|
|
protected $documentID;
|
|
|
|
protected $lineNumber;
|
|
|
|
protected $lineLength;
|
|
|
|
protected $fixedState;
|
|
|
|
protected $hasReplies = 0;
|
|
|
|
protected $replyToCommentPHID;
|
|
|
|
|
|
|
|
public function getApplicationTransactionObject() {
|
|
|
|
return new LegalpadTransaction();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function shouldUseMarkupCache($field) {
|
|
|
|
// Only cache submitted comments.
|
|
|
|
return ($this->getTransactionPHID() != null);
|
|
|
|
}
|
2014-07-10 00:12:48 +02:00
|
|
|
|
2015-01-13 20:47:05 +01:00
|
|
|
protected function getConfiguration() {
|
2014-09-19 14:44:40 +02:00
|
|
|
$config = parent::getConfiguration();
|
|
|
|
$config[self::CONFIG_COLUMN_SCHEMA] = array(
|
|
|
|
'documentID' => 'id?',
|
|
|
|
'lineNumber' => 'uint32',
|
|
|
|
'lineLength' => 'uint32',
|
|
|
|
'fixedState' => 'text12?',
|
|
|
|
'hasReplies' => 'bool',
|
|
|
|
'replyToCommentPHID' => 'phid?',
|
|
|
|
) + $config[self::CONFIG_COLUMN_SCHEMA];
|
|
|
|
$config[self::CONFIG_KEY_SCHEMA] = array(
|
|
|
|
'key_draft' => array(
|
|
|
|
'columns' => array('authorPHID', 'documentID', 'transactionPHID'),
|
2014-10-01 16:53:50 +02:00
|
|
|
'unique' => true,
|
2014-09-19 14:44:40 +02:00
|
|
|
),
|
|
|
|
) + $config[self::CONFIG_KEY_SCHEMA];
|
|
|
|
return $config;
|
|
|
|
}
|
|
|
|
|
2013-07-03 20:15:45 +02:00
|
|
|
}
|