Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/herald/field/HeraldCommentContentField.php
12256 views
1
<?php
2
3
final class HeraldCommentContentField extends HeraldField {
4
5
const FIELDCONST = 'comment.content';
6
7
public function getHeraldFieldName() {
8
return pht('Comment content');
9
}
10
11
public function getFieldGroupKey() {
12
return HeraldTransactionsFieldGroup::FIELDGROUPKEY;
13
}
14
15
public function getHeraldFieldValue($object) {
16
$adapter = $this->getAdapter();
17
18
$xactions = $adapter->getAppliedTransactions();
19
20
$result = array();
21
foreach ($xactions as $xaction) {
22
if (!$xaction->hasComment()) {
23
continue;
24
}
25
26
$comment = $xaction->getComment();
27
$content = $comment->getContent();
28
29
$result[] = $content;
30
}
31
32
return $result;
33
}
34
35
public function supportsObject($object) {
36
return true;
37
}
38
39
protected function getHeraldFieldStandardType() {
40
return self::STANDARD_TEXT_LIST;
41
}
42
43
}
44
45