Add a "Comment content" field to Herald
[phabricator/blender.git] / src / applications / herald / field / HeraldCommentContentField.php
blobd74a78fe4597ec9241fd732c19a6638d30e4c23a
1 <?php
3 final class HeraldCommentContentField extends HeraldField {
5 const FIELDCONST = 'comment.content';
7 public function getHeraldFieldName() {
8 return pht('Comment content');
11 public function getFieldGroupKey() {
12 return HeraldTransactionsFieldGroup::FIELDGROUPKEY;
15 public function getHeraldFieldValue($object) {
16 $adapter = $this->getAdapter();
18 $xactions = $adapter->getAppliedTransactions();
20 $result = array();
21 foreach ($xactions as $xaction) {
22 if (!$xaction->hasComment()) {
23 continue;
26 $comment = $xaction->getComment();
27 $content = $comment->getContent();
29 $result[] = $content;
32 return $result;
35 public function supportsObject($object) {
36 return true;
39 protected function getHeraldFieldStandardType() {
40 return self::STANDARD_TEXT_LIST;