Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/legalpad/storage/LegalpadTransactionComment.php
13456 views
1
<?php
2
3
final class LegalpadTransactionComment
4
extends PhabricatorApplicationTransactionComment {
5
6
protected $documentID;
7
protected $lineNumber = 0;
8
protected $lineLength = 0;
9
protected $fixedState;
10
protected $hasReplies = 0;
11
protected $replyToCommentPHID;
12
13
public function getApplicationTransactionObject() {
14
return new LegalpadTransaction();
15
}
16
17
public function shouldUseMarkupCache($field) {
18
// Only cache submitted comments.
19
return ($this->getTransactionPHID() != null);
20
}
21
22
protected function getConfiguration() {
23
$config = parent::getConfiguration();
24
$config[self::CONFIG_COLUMN_SCHEMA] = array(
25
'documentID' => 'id?',
26
'lineNumber' => 'uint32',
27
'lineLength' => 'uint32',
28
'fixedState' => 'text12?',
29
'hasReplies' => 'bool',
30
'replyToCommentPHID' => 'phid?',
31
) + $config[self::CONFIG_COLUMN_SCHEMA];
32
$config[self::CONFIG_KEY_SCHEMA] = array(
33
'key_draft' => array(
34
'columns' => array('authorPHID', 'documentID', 'transactionPHID'),
35
'unique' => true,
36
),
37
) + $config[self::CONFIG_KEY_SCHEMA];
38
return $config;
39
}
40
41
}
42
43